Load the required libraries

## Loading required package: carData
## randomForest 4.6-14
## Type rfNews() to see new features/changes/bug fixes.
## corrplot 0.84 loaded
## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:randomForest':
## 
##     combine
## The following object is masked from 'package:car':
## 
##     recode
## The following object is masked from 'package:MASS':
## 
##     select
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.3     ✓ purrr   0.3.4
## ✓ tibble  3.1.0     ✓ stringr 1.4.0
## ✓ tidyr   1.1.3     ✓ forcats 0.5.1
## ✓ readr   1.4.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::combine()  masks randomForest::combine()
## x dplyr::filter()   masks stats::filter()
## x dplyr::lag()      masks stats::lag()
## x ggplot2::margin() masks randomForest::margin()
## x dplyr::recode()   masks car::recode()
## x dplyr::select()   masks MASS::select()
## x purrr::some()     masks car::some()
## Loading required package: lattice
## 
## Attaching package: 'caret'
## The following object is masked from 'package:purrr':
## 
##     lift
## 
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
## 
##     lowess
## 
## Attaching package: 'olsrr'
## The following object is masked from 'package:MASS':
## 
##     cement
## The following object is masked from 'package:datasets':
## 
##     rivers
## 
## Attaching package: 'ggpubr'
## The following object is masked from 'package:cowplot':
## 
##     get_legend
## 
## Attaching package: 'rstatix'
## The following object is masked from 'package:MASS':
## 
##     select
## The following object is masked from 'package:stats':
## 
##     filter
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
## 
## Attaching package: 'mice'
## The following object is masked from 'package:stats':
## 
##     filter
## The following objects are masked from 'package:base':
## 
##     cbind, rbind
## Loading required package: colorspace
## Loading required package: grid
## VIM is ready to use.
## Suggestions and bug-reports can be submitted at: https://github.com/statistikat/VIM/issues
## 
## Attaching package: 'VIM'
## The following object is masked from 'package:datasets':
## 
##     sleep
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:MASS':
## 
##     select
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
## 
## Attaching package: 'maps'
## The following object is masked from 'package:purrr':
## 
##     map
## 
## Attaching package: 'ggthemes'
## The following object is masked from 'package:cowplot':
## 
##     theme_map
## 
## Attaching package: 'table1'
## The following objects are masked from 'package:base':
## 
##     units, units<-

Read the data from GitHub

case2 = read.csv("https://raw.githubusercontent.com/RashmiAPatel19/SMU_MSDS_6306_CaseStudy2_Spring2021/main/CaseStudy2-data.csv", header = TRUE)
head(case2)
##   ID Age Attrition    BusinessTravel DailyRate             Department
## 1  1  32        No     Travel_Rarely       117                  Sales
## 2  2  40        No     Travel_Rarely      1308 Research & Development
## 3  3  35        No Travel_Frequently       200 Research & Development
## 4  4  32        No     Travel_Rarely       801                  Sales
## 5  5  24        No Travel_Frequently       567 Research & Development
## 6  6  27        No Travel_Frequently       294 Research & Development
##   DistanceFromHome Education   EducationField EmployeeCount EmployeeNumber
## 1               13         4    Life Sciences             1            859
## 2               14         3          Medical             1           1128
## 3               18         2    Life Sciences             1           1412
## 4                1         4        Marketing             1           2016
## 5                2         1 Technical Degree             1           1646
## 6               10         2    Life Sciences             1            733
##   EnvironmentSatisfaction Gender HourlyRate JobInvolvement JobLevel
## 1                       2   Male         73              3        2
## 2                       3   Male         44              2        5
## 3                       3   Male         60              3        3
## 4                       3 Female         48              3        3
## 5                       1 Female         32              3        1
## 6                       4   Male         32              3        3
##                  JobRole JobSatisfaction MaritalStatus MonthlyIncome
## 1        Sales Executive               4      Divorced          4403
## 2      Research Director               3        Single         19626
## 3 Manufacturing Director               4        Single          9362
## 4        Sales Executive               4       Married         10422
## 5     Research Scientist               4        Single          3760
## 6 Manufacturing Director               1      Divorced          8793
##   MonthlyRate NumCompaniesWorked Over18 OverTime PercentSalaryHike
## 1        9250                  2      Y       No                11
## 2       17544                  1      Y       No                14
## 3       19944                  2      Y       No                11
## 4       24032                  1      Y       No                19
## 5       17218                  1      Y      Yes                13
## 6        4809                  1      Y       No                21
##   PerformanceRating RelationshipSatisfaction StandardHours StockOptionLevel
## 1                 3                        3            80                1
## 2                 3                        1            80                0
## 3                 3                        3            80                0
## 4                 3                        3            80                2
## 5                 3                        3            80                0
## 6                 4                        3            80                2
##   TotalWorkingYears TrainingTimesLastYear WorkLifeBalance YearsAtCompany
## 1                 8                     3               2              5
## 2                21                     2               4             20
## 3                10                     2               3              2
## 4                14                     3               3             14
## 5                 6                     2               3              6
## 6                 9                     4               2              9
##   YearsInCurrentRole YearsSinceLastPromotion YearsWithCurrManager
## 1                  2                       0                    3
## 2                  7                       4                    9
## 3                  2                       2                    2
## 4                 10                       5                    7
## 5                  3                       1                    3
## 6                  7                       1                    7
dim(case2)
## [1] 870  36
plot_histogram(case2)

str(case2)
## 'data.frame':    870 obs. of  36 variables:
##  $ ID                      : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ Age                     : int  32 40 35 32 24 27 41 37 34 34 ...
##  $ Attrition               : chr  "No" "No" "No" "No" ...
##  $ BusinessTravel          : chr  "Travel_Rarely" "Travel_Rarely" "Travel_Frequently" "Travel_Rarely" ...
##  $ DailyRate               : int  117 1308 200 801 567 294 1283 309 1333 653 ...
##  $ Department              : chr  "Sales" "Research & Development" "Research & Development" "Sales" ...
##  $ DistanceFromHome        : int  13 14 18 1 2 10 5 10 10 10 ...
##  $ Education               : int  4 3 2 4 1 2 5 4 4 4 ...
##  $ EducationField          : chr  "Life Sciences" "Medical" "Life Sciences" "Marketing" ...
##  $ EmployeeCount           : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ EmployeeNumber          : int  859 1128 1412 2016 1646 733 1448 1105 1055 1597 ...
##  $ EnvironmentSatisfaction : int  2 3 3 3 1 4 2 4 3 4 ...
##  $ Gender                  : chr  "Male" "Male" "Male" "Female" ...
##  $ HourlyRate              : int  73 44 60 48 32 32 90 88 87 92 ...
##  $ JobInvolvement          : int  3 2 3 3 3 3 4 2 3 2 ...
##  $ JobLevel                : int  2 5 3 3 1 3 1 2 1 2 ...
##  $ JobRole                 : chr  "Sales Executive" "Research Director" "Manufacturing Director" "Sales Executive" ...
##  $ JobSatisfaction         : int  4 3 4 4 4 1 3 4 3 3 ...
##  $ MaritalStatus           : chr  "Divorced" "Single" "Single" "Married" ...
##  $ MonthlyIncome           : int  4403 19626 9362 10422 3760 8793 2127 6694 2220 5063 ...
##  $ MonthlyRate             : int  9250 17544 19944 24032 17218 4809 5561 24223 18410 15332 ...
##  $ NumCompaniesWorked      : int  2 1 2 1 1 1 2 2 1 1 ...
##  $ Over18                  : chr  "Y" "Y" "Y" "Y" ...
##  $ OverTime                : chr  "No" "No" "No" "No" ...
##  $ PercentSalaryHike       : int  11 14 11 19 13 21 12 14 19 14 ...
##  $ PerformanceRating       : int  3 3 3 3 3 4 3 3 3 3 ...
##  $ RelationshipSatisfaction: int  3 1 3 3 3 3 1 3 4 2 ...
##  $ StandardHours           : int  80 80 80 80 80 80 80 80 80 80 ...
##  $ StockOptionLevel        : int  1 0 0 2 0 2 0 3 1 1 ...
##  $ TotalWorkingYears       : int  8 21 10 14 6 9 7 8 1 8 ...
##  $ TrainingTimesLastYear   : int  3 2 2 3 2 4 5 5 2 3 ...
##  $ WorkLifeBalance         : int  2 4 3 3 3 2 2 3 3 2 ...
##  $ YearsAtCompany          : int  5 20 2 14 6 9 4 1 1 8 ...
##  $ YearsInCurrentRole      : int  2 7 2 10 3 7 2 0 1 2 ...
##  $ YearsSinceLastPromotion : int  0 4 2 5 1 1 0 0 0 7 ...
##  $ YearsWithCurrManager    : int  3 9 2 7 3 7 3 0 0 7 ...

Check the variables with vague information and remove the variables

# Checking if the some employees are ages: But no employees were found under 18, so we will remove this variable
unique(case2$Over18)
## [1] "Y"
# Checking for the unique employee count: But every employee count has value=1, so we will remove this variable
unique(case2$EmployeeCount)
## [1] 1
#Checking the employee number: But no duplicate values were found, so we will remove this variable
unique(case2$EmployeeNumber)
##   [1]  859 1128 1412 2016 1646  733 1448 1105 1055 1597 1866 1858  845  508 1314
##  [16]  947  966  487 1755 1903  699  712  663 1613  969 1267 1582 1157 1968  791
##  [31]  195 1698  363 1172 1966  359 1639 1733 1338 1135 1824  783 1674 1595 1270
##  [46] 1480 1734 1119  614  218  662 1423 1246  972   98 1772  752 1586  380 1273
##  [61]  967 1312 1996 1839 1219   21  691 1982   88  391 1999 1469  261 1158 1319
##  [76]   57 1535 1602  302 1974 1033 1728 1997  474 1294 1032  728 1010   56   38
##  [91]  556 1165    4 1587  226  387 1527  139 1513 1447 1434 1453  523  705 1472
## [106] 1177  208 1973 1821 2038 1154  976 1118  771 1218  904 1240 2053  227 1383
## [121]  742 2021  864  709  388 1962   33 1888 1402 1863 1669 1757  551 1654  448
## [136]  807  816 1013  932  152 1373 1308 1007  378 1375  469  252 1560 1173 1622
## [151]  650  722  420 1814  934  475 1986 1127 1126 1242  104 1082  677  347  406
## [166]  922 1655  612  630 1120  747 1934  624 1268  981 1131  787 1053  207  230
## [181] 1182 1355  171 1525  602  377 1653 1676  385  129  441 1833  550  595 1407
## [196]  353  116 1138   36  643  986   96  830  741  330  913 1188  282  197  176
## [211] 2034 1029  715  827  700 1474  634 1900  194 1275  786  684 1681 1506 1940
## [226] 1989   53  284  128 1661 1635   49 1716  303  158  970 2031  679 1987 1656
## [241]  605 1306   94 1439 1150  912  462 2013 1392  625 1994  990  834 1842 1468
## [256] 1813  399 1428 1882 1992 1379 1522  325  974  150   14 1485 1692 1970 1084
## [271] 1845 1658 1864 1436  254 1191  511  430  142 1501 1706  957 1822  438 1152
## [286] 1549 1878   18  154  805  996  419  260 2000 1550 2003  256  147  991  440
## [301]  889   74 1694 2008  977  888 1030 1115 1034  707 1580  601 1537  211  732
## [316] 1003  216 1981 1390 1269  951  683  861 1080 1026  933 1608 1998 1937 1408
## [331] 1677  291 1792  725  140 1101 1137 1103 1113   54   51 1296 1099  680 1211
## [346] 1975 1140  384 1206  762 1911  416 1180 1552 1815 1478  164  565   78  373
## [361]  259 1928 1038  352 1336  532 1285 1548 1592  439 1011  567  425 1640 1680
## [376] 1539 1042 1943 1202 1004  447  177 1466  113 1081  950  314  611 1710  478
## [391]  808   72 1948  573  875  426  575 1467 2026 1496  548  270 1856 1651  856
## [406]  661 1784 1221   23  843  878 1708   61 1853  555 1804  571  407 1196  564
## [421]  110  529  163 1368 1387 1076 1482  379  331  339  437 1340 1420 1762  954
## [436]  458  828 1952   47  724 1235 1709  364 1683 1789 1438 1668 1803   79 1612
## [451] 2009 1475 1797 1924  664 1740 1673  120 1441 1435  591 1659  174 1736 1767
## [466]   24 1556   97 1037  250 1931 1868  101  192 1102   62  868  618 1409 2017
## [481] 1954  895 1932  241  165    1 1876   16   64  757  396 1317 1650 1529 1880
## [496]  851  544  403   13 1929 1360   19 1691   20 1443 1555  485 1391  311   58
## [511] 2041 1397 1720   73  484  408  952 1768 1311 1907  838 1604   86  638  309
## [526] 1050  240 1251  105  161 1088 1585  824 1955  454  262 1125  470  554 1171
## [541] 1224 1798  224  271  804 1701  944  832  421 1049  734  869 1890  945  287
## [556]  656  578  649  836  476  238 1837 1001 1979  806 2020  362 1562  936 1005
## [571] 1909  923 1927 1823  641   77 1961 1471 1633 1260 1358  468 1766  846   40
## [586]  281  107   27 1411   75 1605 1489 1486 1617 1628  855  899  521 2064   45
## [601] 1495 1574 1015 1192 1752  730   91  382 1417 1044 1369  616  328  959  982
## [616] 1696 1502   68 2062  704  137  987  797 2040 1504 1259 1445  461 1096  717
## [631] 1873 1950 1036  155  451 1185 1109 1951  639  667   11 1829 1074 1905 1210
## [646]  215 1156 1718  100 1649 1564 1233 1166  473  593  390  296 1520  466   85
## [661]  772  579 1732 1028   60 1753  312  584 1309 1250  102 1670 1507  881 1647
## [676] 1280  823 1985 2025  941  885  525 1682  223  221  581 1421  305  243 1805
## [691] 1563  376  477  514 1700  925 1644  304 1624 1217 1865 1163 1243 1818  321
## [706]  599 1830 1461 1782  905 1321  568 1258  481  789 1714 1179 1097 1667 1121
## [721]  689 1631 1431 1073 1860  350  900  277  622  169  920  445 1944  631 1577
## [736] 1898 2056 1254  975  652  183  613 1543 1735 2018 1551 1844 1184 1725  242
## [751] 1077 1331 1606 1869  126  744  942 1473 1687 1277  994  820 1329 1040  847
## [766] 1611 1085  615 1228 1117  446  244  343   90 1547  784 1499 1190 1693 2027
## [781]  248  721  910 1220 1731 1430 1786  433 1770 1303 1509  247 1638   83  275
## [796]  702  372 1783 1248 1664   52  604  429 1100  132 1790 1399  217 1729  233
## [811]  239 1415  507 1625  893 1238  833  817  198 1933 1607  349 2035 1160 1614
## [826] 1069 1761 1281 1760  644 1002  167 1216 1193 1278  626 1394  621 1827 1867
## [841]  405 1419  867 1344 1779  536  201  417  492 1918  175   41   15  412 1886
## [856] 1492  297  442  200 1295 1297 1293  502  746 1465 1363  333 1503 1195  269
# Checking he unique values in standard hours: But no values other than 80 found, so we will variable this variable
unique(case2$StandardHours)
## [1] 80
# Checking the unique values of Performance rating: But the the values were kind of vague how it is assigned to employees,so we will remove this variable
unique(case2$PerformanceRating)
## [1] 3 4
# Removing the DailyRate, HourlyRate, MonthlyRate because the the meaning is unclear 
case2=select(case2,-c(ID,Over18, EmployeeCount, StandardHours, EmployeeNumber, DailyRate, HourlyRate, MonthlyRate, PerformanceRating))
dim(case2)
## [1] 870  27
colnames(case2)
##  [1] "Age"                      "Attrition"               
##  [3] "BusinessTravel"           "Department"              
##  [5] "DistanceFromHome"         "Education"               
##  [7] "EducationField"           "EnvironmentSatisfaction" 
##  [9] "Gender"                   "JobInvolvement"          
## [11] "JobLevel"                 "JobRole"                 
## [13] "JobSatisfaction"          "MaritalStatus"           
## [15] "MonthlyIncome"            "NumCompaniesWorked"      
## [17] "OverTime"                 "PercentSalaryHike"       
## [19] "RelationshipSatisfaction" "StockOptionLevel"        
## [21] "TotalWorkingYears"        "TrainingTimesLastYear"   
## [23] "WorkLifeBalance"          "YearsAtCompany"          
## [25] "YearsInCurrentRole"       "YearsSinceLastPromotion" 
## [27] "YearsWithCurrManager"

Plot histogram for analyzing Attrition

ggplot(case2,aes(x=Attrition,fill=Attrition))+geom_bar()+
  geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))

# Check the missing values and handling the missing values.

# Check for missing values
table(is.na(case2))
## 
## FALSE 
## 23490
# Check for the total number of columns that are character and numeric in type
numeric_var_case2=sum(sapply(case2[,1:27],is.numeric))
numeric_var_case2
## [1] 19
char_var_case2=sum(sapply(case2[,1:27],is.character))
char_var_case2
## [1] 8
# Check for the names of  columns that are character and numeric in type
numeric_varname_case2=which(sapply(case2[,1:27],is.numeric))
numeric_varname_case2
##                      Age         DistanceFromHome                Education 
##                        1                        5                        6 
##  EnvironmentSatisfaction           JobInvolvement                 JobLevel 
##                        8                       10                       11 
##          JobSatisfaction            MonthlyIncome       NumCompaniesWorked 
##                       13                       15                       16 
##        PercentSalaryHike RelationshipSatisfaction         StockOptionLevel 
##                       18                       19                       20 
##        TotalWorkingYears    TrainingTimesLastYear          WorkLifeBalance 
##                       21                       22                       23 
##           YearsAtCompany       YearsInCurrentRole  YearsSinceLastPromotion 
##                       24                       25                       26 
##     YearsWithCurrManager 
##                       27
char_varname_case2=which(sapply(case2[,1:27],is.character))
char_varname_case2
##      Attrition BusinessTravel     Department EducationField         Gender 
##              2              3              4              7              9 
##        JobRole  MaritalStatus       OverTime 
##             12             14             17
case2_numeric=case2
var_facs <- c("Attrition","EducationField","MaritalStatus","BusinessTravel","JobRole", "Department", "OverTime", "Gender")
case2_numeric[,var_facs] <- lapply(case2[,var_facs] , factor, ordered = FALSE)

case2_numeric$JobRole <- as.integer(case2_numeric$JobRole)
case2_numeric$Department <- as.integer(case2_numeric$Department)
case2_numeric$MaritalStatus <- as.integer(case2_numeric$MaritalStatus)
case2_numeric$BusinessTravel <- as.integer(case2_numeric$BusinessTravel)
case2_numeric$Education <- as.integer(case2_numeric$Education)
case2_numeric$Attrition <- as.integer(case2_numeric$Attrition)
case2_numeric$OverTime <- as.integer(case2_numeric$OverTime)
case2_numeric$Gender <- as.integer(case2_numeric$Gender)
case2_numeric$EducationField <- as.integer(case2_numeric$EducationField)

str(case2_numeric)
## 'data.frame':    870 obs. of  27 variables:
##  $ Age                     : int  32 40 35 32 24 27 41 37 34 34 ...
##  $ Attrition               : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ BusinessTravel          : int  3 3 2 3 2 2 3 3 3 2 ...
##  $ Department              : int  3 2 2 3 2 2 2 3 3 2 ...
##  $ DistanceFromHome        : int  13 14 18 1 2 10 5 10 10 10 ...
##  $ Education               : int  4 3 2 4 1 2 5 4 4 4 ...
##  $ EducationField          : int  2 4 2 3 6 2 4 2 2 6 ...
##  $ EnvironmentSatisfaction : int  2 3 3 3 1 4 2 4 3 4 ...
##  $ Gender                  : int  2 2 2 1 1 2 2 1 1 2 ...
##  $ JobInvolvement          : int  3 2 3 3 3 3 4 2 3 2 ...
##  $ JobLevel                : int  2 5 3 3 1 3 1 2 1 2 ...
##  $ JobRole                 : int  8 6 5 8 7 5 7 8 9 1 ...
##  $ JobSatisfaction         : int  4 3 4 4 4 1 3 4 3 3 ...
##  $ MaritalStatus           : int  1 3 3 2 3 1 2 1 2 2 ...
##  $ MonthlyIncome           : int  4403 19626 9362 10422 3760 8793 2127 6694 2220 5063 ...
##  $ NumCompaniesWorked      : int  2 1 2 1 1 1 2 2 1 1 ...
##  $ OverTime                : int  1 1 1 1 2 1 2 2 2 1 ...
##  $ PercentSalaryHike       : int  11 14 11 19 13 21 12 14 19 14 ...
##  $ RelationshipSatisfaction: int  3 1 3 3 3 3 1 3 4 2 ...
##  $ StockOptionLevel        : int  1 0 0 2 0 2 0 3 1 1 ...
##  $ TotalWorkingYears       : int  8 21 10 14 6 9 7 8 1 8 ...
##  $ TrainingTimesLastYear   : int  3 2 2 3 2 4 5 5 2 3 ...
##  $ WorkLifeBalance         : int  2 4 3 3 3 2 2 3 3 2 ...
##  $ YearsAtCompany          : int  5 20 2 14 6 9 4 1 1 8 ...
##  $ YearsInCurrentRole      : int  2 7 2 10 3 7 2 0 1 2 ...
##  $ YearsSinceLastPromotion : int  0 4 2 5 1 1 0 0 0 7 ...
##  $ YearsWithCurrManager    : int  3 9 2 7 3 7 3 0 0 7 ...

Categorize the Monthly Income in “Under 30k, 30k to 60k, 60k to 90k, Over90k” by calculating the Yearly Income

** Under 30k for $0-$30000k ** 30k to 60k for $30000k -$60000k ** 60k to 90k for $60000k - $90000k ** Over90k for $90000k and above

summary(case2_numeric$MonthlyIncome)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    1081    2840    4946    6390    8182   19999
case2_numeric$AnnualIncome=cut(case2_numeric$MonthlyIncome, 
    breaks = c(0,2500,5000,7500,999999), 
    labels = c("Under_30k","30k_to_60k","60k_to_90k","Over_90k") 
    )  

dim(case2_numeric)
## [1] 870  28

Plot for Annual Income by Total Working Years

** Less than 5 Yrs for 0 to <5 years ** Less than 15 Yrs for 0 to <15 years ** Less than 30 Yrs for 0 to <30 years ** Less than 40 Yrs for 0 to <40 years

unique(case2$TotalWorkingYears)
##  [1]  8 21 10 14  6  9  7  1  3 17 13 12 26 15  5 28 16 36 37 24  0 32 11 27 23
## [26] 18 30 20 22  4 35  2 25 33 29 19 34 31 40
max(case2$TotalWorkingYears)
## [1] 40
min(case2$TotalWorkingYears)
## [1] 0
median(case2$TotalWorkingYears)
## [1] 10
table(is.na(case2$TotalWorkingYears))
## 
## FALSE 
##   870
cut(case2$TotalWorkingYears, 
        breaks = c(-1,5,15,30,100), 
  labels = c("Less than 5 Yrs","Less than 15 Yrs","Less than 30 Yrs","Less than 40 Yrs") 
 ) -> case2$WorkingYears

summary(case2$WorkingYears)
##  Less than 5 Yrs Less than 15 Yrs Less than 30 Yrs Less than 40 Yrs 
##              186              489              170               25
table(is.na(case2$WorkingYears))
## 
## FALSE 
##   870
ggplot(case2,aes(x=TotalWorkingYears,y=MonthlyIncome,col=JobLevel))+geom_point()+
  geom_smooth(method="lm")
## `geom_smooth()` using formula 'y ~ x'

model1=lm(MonthlyIncome~TotalWorkingYears,data=case2)
summary(model1)
## 
## Call:
## lm(formula = MonthlyIncome ~ TotalWorkingYears, data = case2)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9868.1 -1703.7   -44.5  1453.1 11009.7 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        1124.90     174.19   6.458 1.77e-10 ***
## TotalWorkingYears   476.38      13.04  36.544  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2887 on 868 degrees of freedom
## Multiple R-squared:  0.6061, Adjusted R-squared:  0.6056 
## F-statistic:  1335 on 1 and 868 DF,  p-value: < 2.2e-16

Coorelation plot for numeric variables

** MonthlyIncome & JobLevel = 0.95 ** MonthlyIncome & TotalWorkingYears = 0.78 ** MonthlyIncome & YearsAtCompany = 0.49 ** MonthlyIncome & YearsInCurrentRole = 0.36

corrplot(cor(case2_numeric[,numeric_varname_case2]), order = "alphabet",method="number",
         col = brewer.pal(n = 8, name = "RdBu"))

# When we plot some the numeric variables against MonthlyIncome, we observe the following:

ggplot(case2,aes(x=JobLevel,y=MonthlyIncome,col=JobLevel))+geom_point()+
  geom_smooth(method="lm")
## `geom_smooth()` using formula 'y ~ x'

ggplot(case2,aes(x=TotalWorkingYears,y=MonthlyIncome,col=TotalWorkingYears))+geom_point()+
  geom_smooth(method="lm")
## `geom_smooth()` using formula 'y ~ x'

ggplot(case2,aes(x=YearsAtCompany,y=MonthlyIncome,col=YearsAtCompany))+geom_point()+
  geom_smooth(method="lm")
## `geom_smooth()` using formula 'y ~ x'

ggplot(case2,aes(x=YearsInCurrentRole,y=MonthlyIncome,col=YearsInCurrentRole))+geom_point()+
  geom_smooth(method="lm")
## `geom_smooth()` using formula 'y ~ x'

Plot for checking normality for Monthly Income and Attrition

We split the income values into separate vectors and run some exploratory analysis on them. We see that there are about 5 times as many employees who stay vs those who leave. It also appears the mean MonthlyIncome for employees who leave is somewhat lower:

There is also greater variance in between the two groups as well: * The “Yes” group having a standard deviation of $3786.389 * The “No” group having a standard deviation of $4675.472

attrition.No.monthlyIncome=case2%>%dplyr::select(Attrition,MonthlyIncome)%>%filter(Attrition=="No")
dim(attrition.No.monthlyIncome)
## [1] 730   2
attrition.No.monthlyIncome%>%summarise(Mean=mean(attrition.No.monthlyIncome$MonthlyIncome),
                                       Median=median(attrition.No.monthlyIncome$MonthlyIncome),
                                       Standard.Deviation=sd(attrition.No.monthlyIncome$MonthlyIncome),
                                       IQR=IQR(attrition.No.monthlyIncome$MonthlyIncome))
##   Mean Median Standard.Deviation    IQR
## 1 6702 5208.5           4675.472 5574.5
attrition.Yes.monthlyIncome=case2%>%dplyr::select(Attrition,MonthlyIncome)%>%filter(Attrition=="Yes")
dim(attrition.Yes.monthlyIncome)
## [1] 140   2
attrition.Yes.monthlyIncome%>%summarise(Mean=mean(attrition.Yes.monthlyIncome$MonthlyIncome),
                                       Median=median(attrition.Yes.monthlyIncome$MonthlyIncome),
                                      Standard.Deviation=sd(attrition.Yes.monthlyIncome$MonthlyIncome),
                                       IQR=IQR(attrition.Yes.monthlyIncome$MonthlyIncome))
##       Mean Median Standard.Deviation     IQR
## 1 4764.786   3171           3786.389 3497.25

#Checking assumptions for Attrition and MonthlyIncome and doing T-test

** Visually looking at the histogram and qqplot, it seems like the Attrition data has some right skewness.

** Visually looking at the histogram and qqplot, it seems like the Attrition data has some right skewness.

Because both distributions differ significantly from normality we log transform them in order to do a t-test and see if there is evidence that the distributions differ significantly from each other.

The QQ Plot of the log transformed MonthlyIncome for each group shows much better adherence to normality, and brings the variance of each group much closer together.

*The T-test itself shows there is a significant difference between the Monthly Incomes of “Yes” vs “No” attrition groups, p-value < 0.0001. This is strong evidence that MonthlyIncome has an effect on Attrition

ggplot(attrition.No.monthlyIncome,aes(x=MonthlyIncome))+geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

qqnorm(attrition.No.monthlyIncome$MonthlyIncome)

ggplot(attrition.No.monthlyIncome,aes(x=log(MonthlyIncome)))+geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

qqnorm(log(attrition.No.monthlyIncome$MonthlyIncome))

ggplot(attrition.Yes.monthlyIncome,aes(x=log(MonthlyIncome)))+geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

qqnorm(attrition.Yes.monthlyIncome$MonthlyIncome)

ggplot(attrition.Yes.monthlyIncome,aes(x=MonthlyIncome))+geom_histogram()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

qqnorm(log(attrition.Yes.monthlyIncome$MonthlyIncome))

t.test(log(attrition.Yes.monthlyIncome$MonthlyIncome), log(attrition.No.monthlyIncome$MonthlyIncome), var.equal = F) 
## 
##  Welch Two Sample t-test
## 
## data:  log(attrition.Yes.monthlyIncome$MonthlyIncome) and log(attrition.No.monthlyIncome$MonthlyIncome)
## t = -5.9593, df = 195.72, p-value = 1.16e-08
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.4756331 -0.2391013
## sample estimates:
## mean of x mean of y 
##  8.237820  8.595187

Removing the annual income from the dataframe and creating the model for Attrition

We will create a random forest model for looking at the top influential variables among the 27 variables which leads to Attrition after removing the annual income variable

Attrition

Top 5 most influential were:

case2_numeric -> case2_attrition
dim(case2_attrition)
## [1] 870  28
# Random forest for Attrition
case2_attrition_features <- randomForest(Attrition ~.-AnnualIncome, 
                                     data = case2_attrition, 
                                     importance = TRUE)
## Warning in randomForest.default(m, y, ...): The response has five or fewer
## unique values. Are you sure you want to do regression?
varImpPlot(case2_attrition_features)

# Looking at Top 5 infuential variables correlation with Attrition

** Attrition & OverTime = 0.27 ** Attrition & MOnthlyIncome = -0.15 ** Attrition & StockOptionLevel = -0.15 ** Attrition & Age = -0.15 ** Attrition & YearsAtCompany = -0.13

attrition.factors=data.frame(OverTime=case2_numeric$OverTime,MonthlyIncome=case2$MonthlyIncome,
                             StockOptionLevel=case2_numeric$StockOptionLevel,Attrition=case2_numeric$Attrition,
                             Age=case2$Age,YearsAtCompany=case2$YearsAtCompany)
str(attrition.factors)
## 'data.frame':    870 obs. of  6 variables:
##  $ OverTime        : int  1 1 1 1 2 1 2 2 2 1 ...
##  $ MonthlyIncome   : int  4403 19626 9362 10422 3760 8793 2127 6694 2220 5063 ...
##  $ StockOptionLevel: int  1 0 0 2 0 2 0 3 1 1 ...
##  $ Attrition       : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ Age             : int  32 40 35 32 24 27 41 37 34 34 ...
##  $ YearsAtCompany  : int  5 20 2 14 6 9 4 1 1 8 ...
corrplot(cor(attrition.factors), order = "alphabet",
         col = brewer.pal(n = 8, name = "RdBu"),method="number")

# Looking at OverTime for Attrition

Visually looking at the graph it seems like the employees doing Over time are more likely to leave.

Numerically approximately 57.14% of the employees doing overTime are likely to leave.

ggplot(case2,aes(fill=Attrition,x=OverTime))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  theme(axis.text.x = element_text(angle = 90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+facet_grid(rows = vars(Attrition))

# Looking at Annual Income for Attrition

Visually looking at the graph it seems like the employees earning Under 30k and between 30k to 60k are more likely to leave.

Numerically it is approximately 70.71% of the employees earning below 60k with Attrition=Yes.

case2$AnnualIncome=case2_numeric$AnnualIncome
dim(case2)
## [1] 870  29
ggplot(case2,aes(fill=Attrition,x=AnnualIncome))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  theme(axis.text.x = element_text(angle = 90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+facet_grid(rows = vars(Attrition))

# Looking at Stock Option Level for Attrition

Visually looking at the graph it seems like the employees having 0 Stock Option Level are more likely to leave.

Numerically it is approximately 70.0% of the employees having stock option level=0with Attrition=Yes.

ggplot(case2,aes(fill=Attrition,x=StockOptionLevel))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  theme(axis.text.x = element_text(angle = 90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+facet_grid(rows = vars(Attrition))

# Looking at Age for Attrition

Visually looking at the graph it seems like the employees of 19 to 30 years age are more likely to leave.

Numerically it is approximately 40.71% of the employees having 19 to 30 years age with Attrition=Yes.

case2$AgeEmp=cut(case2$Age, 
        breaks = c(17,30,40,50,60,100), 
  labels = c("19 to 30 years"," 30 to 40 years","40 to 50 years","50 to 60 years","Above 60 years") 
 ) 

ggplot(case2,aes(fill=Attrition,x=AgeEmp))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  theme(axis.text.x = element_text(angle = 90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+facet_grid(rows = vars(Attrition))

# Looking at Years At Company for Attrition

Visually looking at the graph it seems like the employees working at the company being less than equal to 5 year are more likely to leave.

Numerically it is approximately 69.28% of the employees working less than 5 years with Attrition=Yes.

case2$CompanyYears=cut(case2$YearsAtCompany, 
        breaks = c(-1,5,15,30,100), 
  labels = c("Less than 5 Yrs","Less than 15 Yrs","Less than 30 Yrs","Less than 40 Yrs") 
 ) 
summary(case2$YearsAtCompany)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   3.000   5.000   6.962  10.000  40.000
ggplot(case2,aes(fill=Attrition,x=CompanyYears))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  theme(axis.text.x = element_text(angle=90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+
facet_grid(rows = vars(Attrition))

Removing the self-generated variables and Attrition from the dataframe and creating the model for Monthly income

We will create a random forest model for looking at the top influential variables among the 26 variables which leads to higher Monthly Income after removing the self-generated variables and Attrition.

Salary

Top 5 most influential were:

dim(case2)
## [1] 870  31
colnames(case2)
##  [1] "Age"                      "Attrition"               
##  [3] "BusinessTravel"           "Department"              
##  [5] "DistanceFromHome"         "Education"               
##  [7] "EducationField"           "EnvironmentSatisfaction" 
##  [9] "Gender"                   "JobInvolvement"          
## [11] "JobLevel"                 "JobRole"                 
## [13] "JobSatisfaction"          "MaritalStatus"           
## [15] "MonthlyIncome"            "NumCompaniesWorked"      
## [17] "OverTime"                 "PercentSalaryHike"       
## [19] "RelationshipSatisfaction" "StockOptionLevel"        
## [21] "TotalWorkingYears"        "TrainingTimesLastYear"   
## [23] "WorkLifeBalance"          "YearsAtCompany"          
## [25] "YearsInCurrentRole"       "YearsSinceLastPromotion" 
## [27] "YearsWithCurrManager"     "WorkingYears"            
## [29] "AnnualIncome"             "AgeEmp"                  
## [31] "CompanyYears"
case2[,-c(2,28,29,30,31)] -> case2_salary
case2_salary_features <- randomForest(MonthlyIncome ~., 
                                     data = case2_salary, 
 importance = TRUE)
colnames(case2_salary)                                    
##  [1] "Age"                      "BusinessTravel"          
##  [3] "Department"               "DistanceFromHome"        
##  [5] "Education"                "EducationField"          
##  [7] "EnvironmentSatisfaction"  "Gender"                  
##  [9] "JobInvolvement"           "JobLevel"                
## [11] "JobRole"                  "JobSatisfaction"         
## [13] "MaritalStatus"            "MonthlyIncome"           
## [15] "NumCompaniesWorked"       "OverTime"                
## [17] "PercentSalaryHike"        "RelationshipSatisfaction"
## [19] "StockOptionLevel"         "TotalWorkingYears"       
## [21] "TrainingTimesLastYear"    "WorkLifeBalance"         
## [23] "YearsAtCompany"           "YearsInCurrentRole"      
## [25] "YearsSinceLastPromotion"  "YearsWithCurrManager"
varImpPlot(case2_salary_features)

importance(case2_salary_features)
##                              %IncMSE IncNodePurity
## Age                      10.15295268     910237400
## BusinessTravel            2.96987578      45103449
## Department               10.18446305      96957282
## DistanceFromHome          0.58729172     137783035
## Education                 3.95293102      90511137
## EducationField            1.05932040      54272066
## EnvironmentSatisfaction   1.33430815      71455175
## Gender                   -0.80290778      26773291
## JobInvolvement            0.69397599      48026636
## JobLevel                 53.48559654    9118874160
## JobRole                  16.86306932     857973417
## JobSatisfaction          -1.12614958      53946294
## MaritalStatus            -0.81339700      36224693
## NumCompaniesWorked        5.62571126     175756510
## OverTime                 -0.58753739      19138132
## PercentSalaryHike         0.05636773     100246890
## RelationshipSatisfaction  0.40806632      52627577
## StockOptionLevel         -1.98607762      36725984
## TotalWorkingYears        23.11223838    4645332349
## TrainingTimesLastYear     0.08764989      71696937
## WorkLifeBalance          -2.93426843      36786862
## YearsAtCompany           10.82359947     918999192
## YearsInCurrentRole        6.41507442     270072786
## YearsSinceLastPromotion   1.98326881     154492517
## YearsWithCurrManager      4.83937234     202754528

Looking at Top 5 infuential variables correlation with MonthlyIncome

** MonthlyIncome & JobLevel = 0.95(strong relationship) ** MonthlyIncome & TotalWorkingYears = 0.78(Moderate relationship) ** MonthlyIncome & JobRole = -0.08(Moderate relationship) ** MonthlyIncome & YearsAtCompany = 0.49(Moderate relationship) ** MonthlyIncome & Age = 0.48(Moderate relationship)

income.totalYears=data.frame(TotalWorkingYears=case2$TotalWorkingYears,MonthlyIncome=case2$MonthlyIncome,
                             JobRole=case2_numeric$JobRole,JobLevel=case2$JobLevel,
                             Age=case2$Age,YearsAtCompany=case2$YearsAtCompany)
dim(income.totalYears)
## [1] 870   6
corrplot(cor(income.totalYears), order = "alphabet",
         col = brewer.pal(n = 8, name = "RdBu"),method="number")

# Looking at Job Level for Monthly Income

Visually looking at the graph it seems like the employees at Job Level=1 have the earning less than 60k.

Numerically it is approximately 74.26% of the employees at Job Level=1 have the earning less than 60k.

Only 15.67% of the employees earning above 90k are at Job Level=5. No employees at job level=5 are earning below 90k.

ggplot(case2,aes(x=JobLevel,fill=AnnualIncome))+geom_bar(position="stack",stat="count")+
  theme(axis.text.x = element_text(angle = 90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+facet_grid(rows = vars(AnnualIncome))

# Plot for Monthly Income by Total Working Years

** We found that only 10.59% of the employees earning above 90k are working in the company for more than 30 years. None employees are earning below 90k who are working in the company for more than 30 years. ** We also found that none of the employees are earning above 60k who have been working less than 5 years in the company.

ggplot(case2,aes(fill=AnnualIncome,x=WorkingYears))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  facet_grid(rows=vars(AnnualIncome))+
  theme(axis.text.x = element_text(angle = 90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))

# Plot for Monthly Income by Job Role

** We found that only 27.12% of the 870 employees are earning above 90k. ** We also found that every Research Director and Managers in the company have the highest pay which is over 90k. ** We see that no sales representative earn over 90k, in which 98.11% earn below 60k and only 1.89% employees earn 60k to 90k. ** No healthcare representative anf Manufacturing director and Research Scientist earn below 30k.

ggplot(case2,aes(fill=AnnualIncome,x=JobRole))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  facet_grid(rows=vars(AnnualIncome))+
  theme(axis.text.x = element_text(angle = 90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))

# Looking at Years At Company for MonthlyIncome

Visually looking at the graph it seems like the employees working at the company being less than equal to 5 year are more likely to earn below 30k.

Approximately 27.19% of the employees working at the company for less than 5 years are likely to earn below 30k.

Only 3.38% of the employees earning above 90k are working at the company for more than 30 years.

ggplot(case2,aes(fill=AnnualIncome,x=CompanyYears))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  theme(axis.text.x = element_text(angle=90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+
facet_grid(rows = vars(AnnualIncome))

# Looking at Age for Monthly Income

Only 7.65% of the employees having 19 to 30 years age earn above 90k and approximately 31.53% of the employees earn below 30k.

We found that 57.33% of the employees having age 50 to 60 years are earning above 90k.

ggplot(case2,aes(fill=AnnualIncome,x=AgeEmp))+geom_bar(position="stack",stat="count",na.rm = TRUE)+
  theme(axis.text.x = element_text(angle=90))+geom_text(aes(label=..count..),stat="count",position=position_stack(0.5))+
facet_grid(rows = vars(AnnualIncome))

# Building a linear regression model for Monhtly income vs all variables

** R-squared=0.9491; that means the the model is capable of explaining that 94.91% of the monthly income is associated with all the factors given in the data.

Then looking at the variation inflation factor, we see that the department and job role variables are having VIF higher than 10, so in the next step we will remove these two variables.

case2_salary -> case2_salary_reg
# First create model on all variables
lm(MonthlyIncome ~ ., data =  case2_salary_reg) -> case2_salary_lm
summary(case2_salary_lm)
## 
## Call:
## lm(formula = MonthlyIncome ~ ., data = case2_salary_reg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3737.2  -656.2   -33.6   589.1  4136.7 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      -606.140    668.262  -0.907 0.364649    
## Age                                -1.639      5.654  -0.290 0.771955    
## BusinessTravelTravel_Frequently   182.855    141.863   1.289 0.197775    
## BusinessTravelTravel_Rarely       369.777    120.413   3.071 0.002204 ** 
## DepartmentResearch & Development  114.497    478.229   0.239 0.810839    
## DepartmentSales                  -430.542    489.251  -0.880 0.379113    
## DistanceFromHome                   -6.311      4.559  -1.384 0.166647    
## Education                         -30.058     37.243  -0.807 0.419856    
## EducationFieldLife Sciences       131.421    369.673   0.356 0.722301    
## EducationFieldMarketing           106.003    391.782   0.271 0.786792    
## EducationFieldMedical              26.071    370.560   0.070 0.943927    
## EducationFieldOther                84.344    395.567   0.213 0.831205    
## EducationFieldTechnical Degree     87.267    385.419   0.226 0.820930    
## EnvironmentSatisfaction           -10.055     33.561  -0.300 0.764551    
## GenderMale                        119.237     74.663   1.597 0.110648    
## JobInvolvement                     17.245     52.444   0.329 0.742365    
## JobLevel                         2798.801     83.435  33.544  < 2e-16 ***
## JobRoleHuman Resources           -191.727    516.673  -0.371 0.710673    
## JobRoleLaboratory Technician     -603.937    171.759  -3.516 0.000462 ***
## JobRoleManager                   4199.953    282.586  14.863  < 2e-16 ***
## JobRoleManufacturing Director     153.533    170.023   0.903 0.366782    
## JobRoleResearch Director         4012.539    219.451  18.284  < 2e-16 ***
## JobRoleResearch Scientist        -331.361    170.699  -1.941 0.052572 .  
## JobRoleSales Executive            487.672    358.943   1.359 0.174632    
## JobRoleSales Representative       109.404    392.699   0.279 0.780625    
## JobSatisfaction                    23.515     32.974   0.713 0.475958    
## MaritalStatusMarried               70.239    100.024   0.702 0.482740    
## MaritalStatusSingle                16.787    134.568   0.125 0.900753    
## NumCompaniesWorked                  8.757     16.798   0.521 0.602279    
## OverTimeYes                         7.519     81.140   0.093 0.926191    
## PercentSalaryHike                   1.193      9.961   0.120 0.904732    
## RelationshipSatisfaction           16.304     33.297   0.490 0.624510    
## StockOptionLevel                    6.157     56.901   0.108 0.913859    
## TotalWorkingYears                  49.926     10.999   4.539 6.48e-06 ***
## TrainingTimesLastYear              23.730     29.182   0.813 0.416350    
## WorkLifeBalance                   -43.459     51.593  -0.842 0.399844    
## YearsAtCompany                     -2.131     13.620  -0.156 0.875706    
## YearsInCurrentRole                  3.479     17.006   0.205 0.837942    
## YearsSinceLastPromotion            29.344     15.258   1.923 0.054804 .  
## YearsWithCurrManager              -26.775     16.731  -1.600 0.109901    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1061 on 830 degrees of freedom
## Multiple R-squared:  0.9491, Adjusted R-squared:  0.9468 
## F-statistic: 397.2 on 39 and 830 DF,  p-value: < 2.2e-16
# Then test for VIF
vif(case2_salary_lm)
##                                GVIF Df GVIF^(1/(2*Df))
## Age                        1.966832  1        1.402438
## BusinessTravel             1.110032  2        1.026441
## Department               110.874985  2        3.244953
## DistanceFromHome           1.062561  1        1.030806
## Education                  1.120870  1        1.058711
## EducationField             2.898610  5        1.112292
## EnvironmentSatisfaction    1.051126  1        1.025244
## Gender                     1.039965  1        1.019787
## JobInvolvement             1.051408  1        1.025382
## JobLevel                   6.387536  1        2.527358
## JobRole                  494.745698  8        1.473665
## JobSatisfaction            1.042825  1        1.021188
## MaritalStatus              1.984091  2        1.186835
## NumCompaniesWorked         1.384089  1        1.176473
## OverTime                   1.047147  1        1.023302
## PercentSalaryHike          1.034879  1        1.017290
## RelationshipSatisfaction   1.040543  1        1.020070
## StockOptionLevel           1.839351  1        1.356227
## TotalWorkingYears          5.273175  1        2.296339
## TrainingTimesLastYear      1.064991  1        1.031984
## WorkLifeBalance            1.041859  1        1.020715
## YearsAtCompany             5.192457  1        2.278696
## YearsInCurrentRole         2.957481  1        1.719733
## YearsSinceLastPromotion    1.824576  1        1.350768
## YearsWithCurrManager       2.761474  1        1.661768

Removing the department and job role variables and then looking the performace of the model

** R-squared=0.9142; that means the the model is capable of explaining that 91.42% of the monthly income is associated with all the factors given in the data.

Then again looking at the variation inflation factor, we see that the total working years and years at company variables are having VIF higher than 5, so in the next step we will remove these two variables.

case2_salary_reg[,-c(3,11)] -> case2_salary_reg.df
# create model on remaining variables
lm(MonthlyIncome ~ ., data =  case2_salary_reg.df) -> case2_salary_lm
summary(case2_salary_lm)
## 
## Call:
## lm(formula = MonthlyIncome ~ ., data = case2_salary_reg.df)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5887.4  -773.2    -5.9   737.8  4298.4 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     -1782.451    620.768  -2.871  0.00419 ** 
## Age                                -2.495      7.248  -0.344  0.73078    
## BusinessTravelTravel_Frequently    10.519    181.412   0.058  0.95378    
## BusinessTravelTravel_Rarely       320.016    154.308   2.074  0.03840 *  
## DistanceFromHome                  -15.799      5.852  -2.700  0.00707 ** 
## Education                          15.477     47.543   0.326  0.74486    
## EducationFieldLife Sciences      -309.505    364.944  -0.848  0.39663    
## EducationFieldMarketing          -672.812    383.954  -1.752  0.08008 .  
## EducationFieldMedical            -270.299    367.359  -0.736  0.46206    
## EducationFieldOther              -387.162    405.311  -0.955  0.33974    
## EducationFieldTechnical Degree   -312.110    391.375  -0.797  0.42540    
## EnvironmentSatisfaction           -64.796     42.881  -1.511  0.13115    
## GenderMale                         76.079     95.943   0.793  0.42803    
## JobInvolvement                     91.904     67.057   1.371  0.17089    
## JobLevel                         3747.315     69.837  53.658  < 2e-16 ***
## JobSatisfaction                    -1.963     42.486  -0.046  0.96316    
## MaritalStatusMarried              149.809    128.232   1.168  0.24303    
## MaritalStatusSingle                -9.188    172.030  -0.053  0.95742    
## NumCompaniesWorked                -11.593     21.527  -0.539  0.59034    
## OverTimeYes                        27.770    103.798   0.268  0.78912    
## PercentSalaryHike                   9.278     12.808   0.724  0.46902    
## RelationshipSatisfaction           24.974     42.911   0.582  0.56073    
## StockOptionLevel                  -11.084     73.068  -0.152  0.87946    
## TotalWorkingYears                  70.850     13.887   5.102 4.16e-07 ***
## TrainingTimesLastYear              22.175     37.356   0.594  0.55294    
## WorkLifeBalance                   -28.164     66.264  -0.425  0.67093    
## YearsAtCompany                    -10.388     17.366  -0.598  0.54989    
## YearsInCurrentRole                -11.438     21.680  -0.528  0.59791    
## YearsSinceLastPromotion             7.041     19.534   0.360  0.71862    
## YearsWithCurrManager              -44.929     21.373  -2.102  0.03584 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1370 on 840 degrees of freedom
## Multiple R-squared:  0.9142, Adjusted R-squared:  0.9112 
## F-statistic: 308.5 on 29 and 840 DF,  p-value: < 2.2e-16
# Then test for VIF
vif(case2_salary_lm)
##                              GVIF Df GVIF^(1/(2*Df))
## Age                      1.937665  1        1.392000
## BusinessTravel           1.071643  2        1.017449
## DistanceFromHome         1.049644  1        1.024522
## Education                1.095339  1        1.046584
## EducationField           1.157371  5        1.014722
## EnvironmentSatisfaction  1.028985  1        1.014389
## Gender                   1.029746  1        1.014764
## JobInvolvement           1.030792  1        1.015279
## JobLevel                 2.683566  1        1.638159
## JobSatisfaction          1.038164  1        1.018903
## MaritalStatus            1.931779  2        1.178934
## NumCompaniesWorked       1.363027  1        1.167488
## OverTime                 1.027599  1        1.013705
## PercentSalaryHike        1.026095  1        1.012964
## RelationshipSatisfaction 1.036300  1        1.017988
## StockOptionLevel         1.818774  1        1.348619
## TotalWorkingYears        5.040957  1        2.245208
## TrainingTimesLastYear    1.046526  1        1.022999
## WorkLifeBalance          1.030572  1        1.015171
## YearsAtCompany           5.062406  1        2.249979
## YearsInCurrentRole       2.882311  1        1.697737
## YearsSinceLastPromotion  1.793276  1        1.339133
## YearsWithCurrManager     2.702426  1        1.643906

Removing the total working years and years at company variables and then looking the performace of the model

Even after removing the variables having variables with VIF higher than 5, the model is performing good.

** R-squared=0.9142; that means the the model is capable of explaining that 91.42% of the monthly income is associated with all the factors given in the data.

case2_salary_reg.df[,-c(17,20)] -> case2_salary_reg.df
# create model on remaining variables
lm(MonthlyIncome ~ ., data =  case2_salary_reg.df) -> case2_salary_lm
summary(case2_salary_lm)
## 
## Call:
## lm(formula = MonthlyIncome ~ ., data = case2_salary_reg.df)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5899.5  -766.7    -4.8   737.7  4293.3 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     -1874.727    586.219  -3.198  0.00144 ** 
## Age                                -2.356      7.231  -0.326  0.74466    
## BusinessTravelTravel_Frequently     9.868    181.145   0.054  0.95657    
## BusinessTravelTravel_Rarely       321.165    154.100   2.084  0.03745 *  
## DistanceFromHome                  -15.818      5.836  -2.711  0.00685 ** 
## Education                          15.064     47.474   0.317  0.75109    
## EducationFieldLife Sciences      -304.671    364.293  -0.836  0.40320    
## EducationFieldMarketing          -670.452    383.394  -1.749  0.08070 .  
## EducationFieldMedical            -265.549    366.736  -0.724  0.46921    
## EducationFieldOther              -382.144    404.637  -0.944  0.34523    
## EducationFieldTechnical Degree   -309.825    390.918  -0.793  0.42826    
## EnvironmentSatisfaction           -66.308     42.708  -1.553  0.12089    
## GenderMale                         77.232     95.804   0.806  0.42039    
## JobInvolvement                     91.447     66.963   1.366  0.17242    
## JobLevel                         3747.049     69.706  53.755  < 2e-16 ***
## JobSatisfaction                    -1.911     42.405  -0.045  0.96407    
## MaritalStatusMarried              156.815    121.956   1.286  0.19885    
## MaritalStatusSingle                 8.292    132.078   0.063  0.94995    
## NumCompaniesWorked                -12.014     21.469  -0.560  0.57590    
## OverTimeYes                        27.813    103.687   0.268  0.78858    
## PercentSalaryHike                   9.214     12.793   0.720  0.47159    
## RelationshipSatisfaction           24.483     42.841   0.571  0.56782    
## TotalWorkingYears                  70.856     13.871   5.108 4.03e-07 ***
## TrainingTimesLastYear              21.487     37.269   0.577  0.56441    
## YearsAtCompany                    -10.095     17.330  -0.583  0.56037    
## YearsInCurrentRole                -12.475     21.532  -0.579  0.56250    
## YearsSinceLastPromotion             6.959     19.503   0.357  0.72131    
## YearsWithCurrManager              -44.752     21.320  -2.099  0.03611 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1369 on 842 degrees of freedom
## Multiple R-squared:  0.9142, Adjusted R-squared:  0.9114 
## F-statistic: 332.1 on 27 and 842 DF,  p-value: < 2.2e-16
# Then test for VIF
vif(case2_salary_lm)
##                              GVIF Df GVIF^(1/(2*Df))
## Age                      1.932720  1        1.390223
## BusinessTravel           1.069613  2        1.016966
## DistanceFromHome         1.046096  1        1.022788
## Education                1.094511  1        1.046189
## EducationField           1.143749  5        1.013522
## EnvironmentSatisfaction  1.022882  1        1.011376
## Gender                   1.028956  1        1.014374
## JobInvolvement           1.030104  1        1.014941
## JobLevel                 2.679161  1        1.636814
## JobSatisfaction          1.036400  1        1.018037
## MaritalStatus            1.100055  2        1.024126
## NumCompaniesWorked       1.358563  1        1.165574
## OverTime                 1.027584  1        1.013698
## PercentSalaryHike        1.025840  1        1.012838
## RelationshipSatisfaction 1.035095  1        1.017396
## TotalWorkingYears        5.040420  1        2.245088
## TrainingTimesLastYear    1.043864  1        1.021697
## YearsAtCompany           5.051709  1        2.247601
## YearsInCurrentRole       2.849282  1        1.687982
## YearsSinceLastPromotion  1.791245  1        1.338374
## YearsWithCurrManager     2.694799  1        1.641584

Using StepWise Slection for feature selection

Now that we have used multicollinearity to reduce to 22 parameters, we now will run Stepwise Feature Selection to find the 6 most influential variables and compare them to both what the Random Forest found as well as the prior Linear Regression.

Important Factors that all have p-value <= 0.05:

We can see the RMSE of this model is $1369.276

And the Adjusted R-squared is 0.9119, which means an estimated 91.19% of the MonthlyIncome variable can be accounted for by this model.

dim(case2_salary_reg.df)
## [1] 870  22
trainControl(method = "cv", number = 5) -> train.CV

train(MonthlyIncome ~ .,
  data = case2_salary_reg.df,
  method = "lmStepAIC",
  trControl = train.CV
) -> case2.salary.stepwise
## Start:  AIC=10094.13
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - MaritalStatusSingle               1       3933 1277222650 10092
## - Education                         1      11237 1277229955 10092
## - OverTimeYes                       1      13718 1277232435 10092
## - RelationshipSatisfaction          1     147196 1277365913 10092
## - YearsAtCompany                    1     184241 1277402959 10092
## - Age                               1     186310 1277405028 10092
## - YearsSinceLastPromotion           1     285124 1277503842 10092
## - YearsInCurrentRole                1     553758 1277772475 10092
## - TrainingTimesLastYear             1     683223 1277901940 10092
## - EducationFieldMedical             1     713528 1277932245 10092
## - `EducationFieldTechnical Degree`  1     794925 1278013642 10093
## - JobSatisfaction                   1     869981 1278088699 10093
## - NumCompaniesWorked                1     994591 1278213308 10093
## - EducationFieldOther               1    1308094 1278526811 10093
## - EnvironmentSatisfaction           1    1928423 1279147141 10093
## - `EducationFieldLife Sciences`     1    2102002 1279320719 10093
## - JobInvolvement                    1    2195740 1279414457 10093
## - GenderMale                        1    2512010 1279730727 10094
## - BusinessTravelTravel_Frequently   1    3464546 1280683264 10094
## - PercentSalaryHike                 1    3581391 1280800108 10094
## <none>                                           1277218717 10094
## - MaritalStatusMarried              1    4197525 1281416242 10094
## - EducationFieldMarketing           1    5729691 1282948409 10095
## - DistanceFromHome                  1    6482972 1283701689 10096
## - YearsWithCurrManager              1    7540595 1284759312 10096
## - BusinessTravelTravel_Rarely       1   14890708 1292109425 10100
## - TotalWorkingYears                 1   42527444 1319746162 10115
## - JobLevel                          1 4105339338 5382558056 11093
## 
## Step:  AIC=10092.13
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Education                         1      11103 1277233753 10090
## - OverTimeYes                       1      13958 1277236609 10090
## - RelationshipSatisfaction          1     149235 1277371885 10090
## - Age                               1     183540 1277406191 10090
## - YearsAtCompany                    1     183854 1277406505 10090
## - YearsSinceLastPromotion           1     283981 1277506631 10090
## - YearsInCurrentRole                1     558484 1277781135 10090
## - TrainingTimesLastYear             1     681973 1277904624 10090
## - EducationFieldMedical             1     710864 1277933514 10090
## - `EducationFieldTechnical Degree`  1     792136 1278014786 10091
## - JobSatisfaction                   1     872417 1278095068 10091
## - NumCompaniesWorked                1     997595 1278220246 10091
## - EducationFieldOther               1    1305382 1278528032 10091
## - EnvironmentSatisfaction           1    1939299 1279161950 10091
## - `EducationFieldLife Sciences`     1    2098106 1279320757 10091
## - JobInvolvement                    1    2194600 1279417251 10091
## - GenderMale                        1    2510520 1279733171 10092
## - BusinessTravelTravel_Frequently   1    3505828 1280728479 10092
## - PercentSalaryHike                 1    3582438 1280805088 10092
## <none>                                           1277222650 10092
## - EducationFieldMarketing           1    5725908 1282948559 10093
## - MaritalStatusMarried              1    6477417 1283700067 10094
## - DistanceFromHome                  1    6487919 1283710570 10094
## - YearsWithCurrManager              1    7543192 1284765842 10094
## - BusinessTravelTravel_Rarely       1   15022209 1292244860 10098
## - TotalWorkingYears                 1   42599911 1319822561 10113
## - JobLevel                          1 4115860173 5393082823 11093
## 
## Step:  AIC=10090.14
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - OverTimeYes                       1      14625 1277248378 10088
## - RelationshipSatisfaction          1     145526 1277379280 10088
## - YearsAtCompany                    1     177173 1277410926 10088
## - Age                               1     203920 1277437673 10088
## - YearsSinceLastPromotion           1     286714 1277520467 10088
## - YearsInCurrentRole                1     551838 1277785591 10088
## - TrainingTimesLastYear             1     675223 1277908976 10088
## - EducationFieldMedical             1     717133 1277950886 10088
## - `EducationFieldTechnical Degree`  1     797167 1278030920 10089
## - JobSatisfaction                   1     884898 1278118652 10089
## - NumCompaniesWorked                1     986591 1278220345 10089
## - EducationFieldOther               1    1306385 1278540138 10089
## - EnvironmentSatisfaction           1    1959751 1279193504 10089
## - `EducationFieldLife Sciences`     1    2104894 1279338647 10089
## - JobInvolvement                    1    2207354 1279441107 10089
## - GenderMale                        1    2512734 1279746488 10090
## - BusinessTravelTravel_Frequently   1    3502635 1280736388 10090
## - PercentSalaryHike                 1    3590497 1280824250 10090
## <none>                                           1277233753 10090
## - EducationFieldMarketing           1    5720329 1282954082 10091
## - DistanceFromHome                  1    6481953 1283715707 10092
## - MaritalStatusMarried              1    6489379 1283723132 10092
## - YearsWithCurrManager              1    7571339 1284805093 10092
## - BusinessTravelTravel_Rarely       1   15023763 1292257517 10096
## - TotalWorkingYears                 1   42617577 1319851330 10111
## - JobLevel                          1 4125650668 5402884421 11092
## 
## Step:  AIC=10088.15
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - RelationshipSatisfaction          1     145494 1277393872 10086
## - YearsAtCompany                    1     173951 1277422330 10086
## - Age                               1     199397 1277447775 10086
## - YearsSinceLastPromotion           1     285081 1277533459 10086
## - YearsInCurrentRole                1     551330 1277799708 10086
## - TrainingTimesLastYear             1     682820 1277931198 10086
## - EducationFieldMedical             1     722794 1277971173 10086
## - `EducationFieldTechnical Degree`  1     800392 1278048770 10087
## - JobSatisfaction                   1     876389 1278124767 10087
## - NumCompaniesWorked                1     993933 1278242311 10087
## - EducationFieldOther               1    1312321 1278560699 10087
## - EnvironmentSatisfaction           1    1993920 1279242298 10087
## - `EducationFieldLife Sciences`     1    2111871 1279360250 10087
## - JobInvolvement                    1    2220018 1279468396 10087
## - GenderMale                        1    2510599 1279758977 10088
## - BusinessTravelTravel_Frequently   1    3489565 1280737943 10088
## - PercentSalaryHike                 1    3580419 1280828797 10088
## <none>                                           1277248378 10088
## - EducationFieldMarketing           1    5741398 1282989776 10089
## - DistanceFromHome                  1    6528195 1283776574 10090
## - MaritalStatusMarried              1    6541440 1283789819 10090
## - YearsWithCurrManager              1    7556815 1284805193 10090
## - BusinessTravelTravel_Rarely       1   15023196 1292271575 10094
## - TotalWorkingYears                 1   42694436 1319942814 10109
## - JobLevel                          1 4126263815 5403512193 11090
## 
## Step:  AIC=10086.23
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsAtCompany                    1     189375 1277583248 10084
## - Age                               1     201856 1277595728 10084
## - YearsSinceLastPromotion           1     298700 1277692572 10084
## - YearsInCurrentRole                1     550895 1277944767 10084
## - TrainingTimesLastYear             1     675344 1278069217 10085
## - EducationFieldMedical             1     745509 1278139382 10085
## - `EducationFieldTechnical Degree`  1     835734 1278229607 10085
## - JobSatisfaction                   1     857640 1278251512 10085
## - NumCompaniesWorked                1     939930 1278333803 10085
## - EducationFieldOther               1    1360004 1278753877 10085
## - EnvironmentSatisfaction           1    1988666 1279382539 10085
## - `EducationFieldLife Sciences`     1    2182417 1279576290 10085
## - JobInvolvement                    1    2240855 1279634727 10085
## - GenderMale                        1    2527149 1279921021 10086
## - PercentSalaryHike                 1    3524295 1280918167 10086
## - BusinessTravelTravel_Frequently   1    3538905 1280932777 10086
## <none>                                           1277393872 10086
## - EducationFieldMarketing           1    5820765 1283214638 10087
## - DistanceFromHome                  1    6426522 1283820395 10088
## - MaritalStatusMarried              1    6439850 1283833722 10088
## - YearsWithCurrManager              1    7638533 1285032405 10088
## - BusinessTravelTravel_Rarely       1   14975486 1292369358 10092
## - TotalWorkingYears                 1   42557813 1319951685 10107
## - JobLevel                          1 4133336509 5410730381 11089
## 
## Step:  AIC=10084.33
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Age                               1     177587 1277760835 10082
## - YearsInCurrentRole                1     373671 1277956919 10082
## - YearsSinceLastPromotion           1     447563 1278030810 10083
## - TrainingTimesLastYear             1     749254 1278332502 10083
## - EducationFieldMedical             1     769714 1278352962 10083
## - `EducationFieldTechnical Degree`  1     885654 1278468902 10083
## - JobSatisfaction                   1     918057 1278501305 10083
## - NumCompaniesWorked                1    1277835 1278861083 10083
## - EducationFieldOther               1    1425591 1279008839 10083
## - EnvironmentSatisfaction           1    2010680 1279593928 10083
## - JobInvolvement                    1    2126868 1279710116 10084
## - `EducationFieldLife Sciences`     1    2253996 1279837244 10084
## - GenderMale                        1    2485081 1280068329 10084
## - PercentSalaryHike                 1    3515448 1281098696 10084
## - BusinessTravelTravel_Frequently   1    3536146 1281119394 10084
## <none>                                           1277583248 10084
## - EducationFieldMarketing           1    5926559 1283509807 10086
## - MaritalStatusMarried              1    6471119 1284054367 10086
## - DistanceFromHome                  1    6604590 1284187838 10086
## - YearsWithCurrManager              1    8208644 1285791892 10087
## - BusinessTravelTravel_Rarely       1   14999969 1292583217 10090
## - TotalWorkingYears                 1   47481315 1325064563 10108
## - JobLevel                          1 4190246641 5467829889 11094
## 
## Step:  AIC=10082.43
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsInCurrentRole                1     392655 1278153490 10081
## - YearsSinceLastPromotion           1     438009 1278198844 10081
## - TrainingTimesLastYear             1     745113 1278505948 10081
## - EducationFieldMedical             1     762954 1278523789 10081
## - `EducationFieldTechnical Degree`  1     866955 1278627790 10081
## - JobSatisfaction                   1     940773 1278701608 10081
## - NumCompaniesWorked                1    1195648 1278956483 10081
## - EducationFieldOther               1    1434546 1279195381 10081
## - EnvironmentSatisfaction           1    2014143 1279774978 10082
## - JobInvolvement                    1    2180044 1279940879 10082
## - `EducationFieldLife Sciences`     1    2219911 1279980745 10082
## - GenderMale                        1    2479139 1280239974 10082
## - BusinessTravelTravel_Frequently   1    3474830 1281235665 10082
## - PercentSalaryHike                 1    3541062 1281301896 10082
## <none>                                           1277760835 10082
## - EducationFieldMarketing           1    5858605 1283619440 10084
## - DistanceFromHome                  1    6555000 1284315835 10084
## - MaritalStatusMarried              1    6590146 1284350981 10084
## - YearsWithCurrManager              1    8485294 1286246129 10085
## - BusinessTravelTravel_Rarely       1   14868961 1292629796 10088
## - TotalWorkingYears                 1   64353505 1342114340 10115
## - JobLevel                          1 4197035985 5474796820 11093
## 
## Step:  AIC=10080.64
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsSinceLastPromotion           1     268151 1278421641 10079
## - TrainingTimesLastYear             1     751220 1278904710 10079
## - EducationFieldMedical             1     778701 1278932191 10079
## - `EducationFieldTechnical Degree`  1     907493 1279060983 10079
## - JobSatisfaction                   1     945468 1279098958 10079
## - NumCompaniesWorked                1    1073995 1279227485 10079
## - EducationFieldOther               1    1459270 1279612760 10079
## - JobInvolvement                    1    2148793 1280302283 10080
## - EnvironmentSatisfaction           1    2191677 1280345167 10080
## - `EducationFieldLife Sciences`     1    2247605 1280401095 10080
## - GenderMale                        1    2558060 1280711550 10080
## - BusinessTravelTravel_Frequently   1    3441881 1281595371 10080
## - PercentSalaryHike                 1    3480525 1281634015 10080
## <none>                                           1278153490 10081
## - EducationFieldMarketing           1    5922499 1284075989 10082
## - MaritalStatusMarried              1    6376589 1284530079 10082
## - DistanceFromHome                  1    6599646 1284753136 10082
## - YearsWithCurrManager              1   13703276 1291856766 10086
## - BusinessTravelTravel_Rarely       1   14703984 1292857474 10087
## - TotalWorkingYears                 1   64419857 1342573347 10113
## - JobLevel                          1 4196647646 5474801136 11091
## 
## Step:  AIC=10078.79
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - TrainingTimesLastYear             1     691799 1279113440 10077
## - EducationFieldMedical             1     723286 1279144927 10077
## - `EducationFieldTechnical Degree`  1     851991 1279273632 10077
## - JobSatisfaction                   1     915977 1279337618 10077
## - NumCompaniesWorked                1    1209162 1279630804 10077
## - EducationFieldOther               1    1424875 1279846516 10078
## - JobInvolvement                    1    2105761 1280527402 10078
## - EnvironmentSatisfaction           1    2120144 1280541785 10078
## - `EducationFieldLife Sciences`     1    2176228 1280597869 10078
## - GenderMale                        1    2541424 1280963065 10078
## - PercentSalaryHike                 1    3425381 1281847022 10079
## - BusinessTravelTravel_Frequently   1    3473887 1281895528 10079
## <none>                                           1278421641 10079
## - EducationFieldMarketing           1    5801646 1284223287 10080
## - MaritalStatusMarried              1    6489072 1284910713 10080
## - DistanceFromHome                  1    6683735 1285105376 10080
## - YearsWithCurrManager              1   14056274 1292477915 10084
## - BusinessTravelTravel_Rarely       1   14597755 1293019396 10085
## - TotalWorkingYears                 1   69287708 1347709349 10114
## - JobLevel                          1 4201541601 5479963242 11090
## 
## Step:  AIC=10077.16
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - EducationFieldMedical             1     665702 1279779142 10076
## - `EducationFieldTechnical Degree`  1     829034 1279942474 10076
## - JobSatisfaction                   1     906669 1280020110 10076
## - NumCompaniesWorked                1    1317650 1280431090 10076
## - EducationFieldOther               1    1399874 1280513314 10076
## - JobInvolvement                    1    2019563 1281133003 10076
## - `EducationFieldLife Sciences`     1    2151726 1281265166 10076
## - EnvironmentSatisfaction           1    2182004 1281295444 10076
## - GenderMale                        1    2416431 1281529872 10076
## - PercentSalaryHike                 1    3407133 1282520573 10077
## - BusinessTravelTravel_Frequently   1    3610803 1282724243 10077
## <none>                                           1279113440 10077
## - EducationFieldMarketing           1    5809317 1284922757 10078
## - MaritalStatusMarried              1    6238331 1285351771 10078
## - DistanceFromHome                  1    6828713 1285942153 10079
## - YearsWithCurrManager              1   13972529 1293085969 10083
## - BusinessTravelTravel_Rarely       1   14874455 1293987895 10083
## - TotalWorkingYears                 1   69056796 1348170236 10112
## - JobLevel                          1 4200918151 5480031591 11088
## 
## Step:  AIC=10075.52
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldTechnical Degree`  1     166529 1279945672 10074
## - EducationFieldOther               1     817358 1280596500 10074
## - JobSatisfaction                   1     858983 1280638125 10074
## - NumCompaniesWorked                1    1393381 1281172524 10074
## - JobInvolvement                    1    2020166 1281799309 10075
## - EnvironmentSatisfaction           1    2130002 1281909144 10075
## - GenderMale                        1    2524358 1282303500 10075
## - PercentSalaryHike                 1    3352634 1283131777 10075
## - BusinessTravelTravel_Frequently   1    3639304 1283418446 10076
## <none>                                           1279779142 10076
## - `EducationFieldLife Sciences`     1    4360268 1284139411 10076
## - MaritalStatusMarried              1    6689645 1286468787 10077
## - DistanceFromHome                  1    6926652 1286705795 10077
## - EducationFieldMarketing           1   13457369 1293236512 10081
## - YearsWithCurrManager              1   14301615 1294080757 10081
## - BusinessTravelTravel_Rarely       1   14817443 1294596585 10082
## - TotalWorkingYears                 1   69221779 1349000921 10110
## - JobLevel                          1 4203059991 5482839133 11086
## 
## Step:  AIC=10073.61
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + JobSatisfaction + MaritalStatusMarried + 
##     NumCompaniesWorked + PercentSalaryHike + TotalWorkingYears + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - EducationFieldOther              1     714256 1280659928 10072
## - JobSatisfaction                  1     874910 1280820582 10072
## - NumCompaniesWorked               1    1396477 1281342148 10072
## - JobInvolvement                   1    2039353 1281985024 10073
## - EnvironmentSatisfaction          1    2193709 1282139381 10073
## - GenderMale                       1    2549664 1282495335 10073
## - PercentSalaryHike                1    3503166 1283448837 10074
## - BusinessTravelTravel_Frequently  1    3622491 1283568162 10074
## <none>                                          1279945672 10074
## - `EducationFieldLife Sciences`    1    4295251 1284240923 10074
## - MaritalStatusMarried             1    6603817 1286549489 10075
## - DistanceFromHome                 1    6864199 1286809871 10075
## - EducationFieldMarketing          1   13481182 1293426854 10079
## - YearsWithCurrManager             1   14281602 1294227274 10079
## - BusinessTravelTravel_Rarely      1   14733594 1294679265 10080
## - TotalWorkingYears                1   69402169 1349347841 10108
## - JobLevel                         1 4206224093 5486169764 11085
## 
## Step:  AIC=10072
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - JobSatisfaction                  1     817766 1281477694 10070
## - NumCompaniesWorked               1    1370610 1282030538 10071
## - JobInvolvement                   1    2111606 1282771534 10071
## - EnvironmentSatisfaction          1    2323031 1282982959 10071
## - GenderMale                       1    2494376 1283154304 10071
## - PercentSalaryHike                1    3297702 1283957630 10072
## - BusinessTravelTravel_Frequently  1    3579861 1284239788 10072
## <none>                                          1280659928 10072
## - `EducationFieldLife Sciences`    1    3693699 1284353627 10072
## - MaritalStatusMarried             1    6481538 1287141466 10074
## - DistanceFromHome                 1    6841280 1287501207 10074
## - EducationFieldMarketing          1   12826966 1293486894 10077
## - YearsWithCurrManager             1   14143975 1294803903 10078
## - BusinessTravelTravel_Rarely      1   14568558 1295228485 10078
## - TotalWorkingYears                1   69673278 1350333206 10107
## - JobLevel                         1 4206537950 5487197877 11083
## 
## Step:  AIC=10070.45
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + PercentSalaryHike + 
##     TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - NumCompaniesWorked               1    1524146 1283001840 10069
## - JobInvolvement                   1    2028152 1283505846 10070
## - EnvironmentSatisfaction          1    2384583 1283862277 10070
## - GenderMale                       1    2600231 1284077925 10070
## - PercentSalaryHike                1    3174478 1284652171 10070
## - `EducationFieldLife Sciences`    1    3572898 1285050591 10070
## <none>                                          1281477694 10070
## - BusinessTravelTravel_Frequently  1    3716671 1285194365 10070
## - MaritalStatusMarried             1    6571819 1288049513 10072
## - DistanceFromHome                 1    7005214 1288482908 10072
## - EducationFieldMarketing          1   12669555 1294147249 10075
## - YearsWithCurrManager             1   14235383 1295713077 10076
## - BusinessTravelTravel_Rarely      1   14393032 1295870726 10076
## - TotalWorkingYears                1   69497923 1350975616 10105
## - JobLevel                         1 4207626981 5489104674 11081
## 
## Step:  AIC=10069.27
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + PercentSalaryHike + TotalWorkingYears + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - JobInvolvement                   1    2036687 1285038527 10068
## - EnvironmentSatisfaction          1    2537273 1285539114 10069
## - GenderMale                       1    2636462 1285638302 10069
## - PercentSalaryHike                1    3275334 1286277174 10069
## - `EducationFieldLife Sciences`    1    3577153 1286578993 10069
## <none>                                          1283001840 10069
## - BusinessTravelTravel_Frequently  1    3996554 1286998394 10069
## - MaritalStatusMarried             1    6576459 1289578300 10071
## - DistanceFromHome                 1    6727742 1289729582 10071
## - EducationFieldMarketing          1   12638379 1295640219 10074
## - YearsWithCurrManager             1   12763074 1295764915 10074
## - BusinessTravelTravel_Rarely      1   15067240 1298069080 10075
## - TotalWorkingYears                1   71081533 1354083373 10105
## - JobLevel                         1 4315563408 5598565248 11093
## 
## Step:  AIC=10068.38
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EnvironmentSatisfaction + GenderMale + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - EnvironmentSatisfaction          1    2418915 1287457442 10068
## - GenderMale                       1    2817430 1287855957 10068
## - PercentSalaryHike                1    3309871 1288348398 10068
## - `EducationFieldLife Sciences`    1    3419361 1288457888 10068
## <none>                                          1285038527 10068
## - BusinessTravelTravel_Frequently  1    4297608 1289336135 10069
## - DistanceFromHome                 1    6474902 1291513429 10070
## - MaritalStatusMarried             1    6661053 1291699580 10070
## - YearsWithCurrManager             1   12404007 1297442535 10073
## - EducationFieldMarketing          1   13129759 1298168286 10074
## - BusinessTravelTravel_Rarely      1   15957439 1300995966 10075
## - TotalWorkingYears                1   70558468 1355596996 10104
## - JobLevel                         1 4315545138 5600583665 11091
## 
## Step:  AIC=10067.69
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     GenderMale + JobLevel + MaritalStatusMarried + PercentSalaryHike + 
##     TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - GenderMale                       1    2546207 1290003649 10067
## - `EducationFieldLife Sciences`    1    3390093 1290847535 10068
## - PercentSalaryHike                1    3404942 1290862385 10068
## <none>                                          1287457442 10068
## - BusinessTravelTravel_Frequently  1    4340543 1291797985 10068
## - DistanceFromHome                 1    6147637 1293605079 10069
## - MaritalStatusMarried             1    6767611 1294225054 10069
## - YearsWithCurrManager             1   12502596 1299960038 10072
## - EducationFieldMarketing          1   12870048 1300327491 10073
## - BusinessTravelTravel_Rarely      1   16301872 1303759315 10074
## - TotalWorkingYears                1   71916849 1359374291 10104
## - JobLevel                         1 4315997543 5603454985 11089
## 
## Step:  AIC=10067.06
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     JobLevel + MaritalStatusMarried + PercentSalaryHike + TotalWorkingYears + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - PercentSalaryHike                1    3313951 1293317600 10067
## - `EducationFieldLife Sciences`    1    3320404 1293324053 10067
## <none>                                          1290003649 10067
## - BusinessTravelTravel_Frequently  1    4025633 1294029282 10067
## - DistanceFromHome                 1    6214589 1296218238 10068
## - MaritalStatusMarried             1    6378090 1296381739 10068
## - YearsWithCurrManager             1   13186087 1303189736 10072
## - EducationFieldMarketing          1   13261541 1303265190 10072
## - BusinessTravelTravel_Rarely      1   15954312 1305957961 10074
## - TotalWorkingYears                1   71356211 1361359860 10102
## - JobLevel                         1 4313685885 5603689534 11087
## 
## Step:  AIC=10066.85
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     JobLevel + MaritalStatusMarried + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - `EducationFieldLife Sciences`    1    3117201 1296434801 10066
## <none>                                          1293317600 10067
## - BusinessTravelTravel_Frequently  1    3772484 1297090084 10067
## - DistanceFromHome                 1    5719588 1299037189 10068
## - MaritalStatusMarried             1    6048741 1299366342 10068
## - EducationFieldMarketing          1   13371392 1306688992 10072
## - YearsWithCurrManager             1   13837212 1307154812 10072
## - BusinessTravelTravel_Rarely      1   15722397 1309039997 10073
## - TotalWorkingYears                1   71144937 1364462537 10102
## - JobLevel                         1 4311266793 5604584393 11085
## 
## Step:  AIC=10066.52
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - BusinessTravelTravel_Frequently  1    3642031 1300076833 10066
## <none>                                          1296434801 10066
## - DistanceFromHome                 1    5550594 1301985396 10068
## - MaritalStatusMarried             1    5851701 1302286502 10068
## - EducationFieldMarketing          1   10752571 1307187373 10070
## - YearsWithCurrManager             1   14083954 1310518756 10072
## - BusinessTravelTravel_Rarely      1   15490611 1311925413 10073
## - TotalWorkingYears                1   71644368 1368079169 10102
## - JobLevel                         1 4308282147 5604716948 11084
## 
## Step:  AIC=10066.48
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     JobLevel + MaritalStatusMarried + TotalWorkingYears + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## <none>                                      1300076833 10066
## - DistanceFromHome             1    5811455 1305888288 10068
## - MaritalStatusMarried         1    5869175 1305946008 10068
## - EducationFieldMarketing      1   10573518 1310650351 10070
## - BusinessTravelTravel_Rarely  1   13455067 1313531900 10072
## - YearsWithCurrManager         1   13881113 1313957946 10072
## - TotalWorkingYears            1   72891067 1372967900 10102
## - JobLevel                     1 4304640650 5604717483 11082
## Start:  AIC=10068.32
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Education                         1         39 1230718328 10066
## - `EducationFieldLife Sciences`     1        682 1230718972 10066
## - OverTimeYes                       1        843 1230719132 10066
## - `EducationFieldTechnical Degree`  1       6722 1230725012 10066
## - EducationFieldMedical             1       6806 1230725096 10066
## - NumCompaniesWorked                1      15002 1230733292 10066
## - JobSatisfaction                   1      18646 1230736935 10066
## - TrainingTimesLastYear             1     169168 1230887458 10066
## - EducationFieldOther               1     349461 1231067750 10066
## - YearsAtCompany                    1     368385 1231086674 10066
## - Age                               1     423902 1231142192 10067
## - YearsSinceLastPromotion           1     449126 1231167416 10067
## - BusinessTravelTravel_Frequently   1     479213 1231197502 10067
## - EducationFieldMarketing           1     658483 1231376772 10067
## - PercentSalaryHike                 1    1121551 1231839840 10067
## - GenderMale                        1    1599493 1232317783 10067
## - YearsInCurrentRole                1    2083498 1232801787 10068
## - MaritalStatusMarried              1    2483295 1233201584 10068
## - MaritalStatusSingle               1    2565608 1233283897 10068
## - JobInvolvement                    1    2985433 1233703723 10068
## - EnvironmentSatisfaction           1    3148410 1233866699 10068
## <none>                                           1230718289 10068
## - YearsWithCurrManager              1    4168576 1234886865 10069
## - RelationshipSatisfaction          1    4427955 1235146244 10069
## - BusinessTravelTravel_Rarely       1    6803702 1237521991 10070
## - DistanceFromHome                  1    9613437 1240331726 10072
## - TotalWorkingYears                 1   32734808 1263453097 10085
## - JobLevel                          1 4266274521 5496992811 11108
## 
## Step:  AIC=10066.32
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + MaritalStatusSingle + 
##     NumCompaniesWorked + OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldLife Sciences`     1        672 1230719000 10064
## - OverTimeYes                       1        835 1230719163 10064
## - `EducationFieldTechnical Degree`  1       6736 1230725065 10064
## - EducationFieldMedical             1       6778 1230725106 10064
## - NumCompaniesWorked                1      15119 1230733447 10064
## - JobSatisfaction                   1      18637 1230736966 10064
## - TrainingTimesLastYear             1     169348 1230887676 10064
## - EducationFieldOther               1     349572 1231067901 10064
## - YearsAtCompany                    1     368450 1231086778 10064
## - Age                               1     430653 1231148981 10065
## - YearsSinceLastPromotion           1     449818 1231168146 10065
## - BusinessTravelTravel_Frequently   1     479465 1231197793 10065
## - EducationFieldMarketing           1     658646 1231376974 10065
## - PercentSalaryHike                 1    1122733 1231841061 10065
## - GenderMale                        1    1599598 1232317927 10065
## - YearsInCurrentRole                1    2086166 1232804494 10066
## - MaritalStatusMarried              1    2483562 1233201891 10066
## - MaritalStatusSingle               1    2571419 1233289747 10066
## - JobInvolvement                    1    2988370 1233706699 10066
## - EnvironmentSatisfaction           1    3150029 1233868358 10066
## <none>                                           1230718328 10066
## - YearsWithCurrManager              1    4191040 1234909368 10067
## - RelationshipSatisfaction          1    4434711 1235153039 10067
## - BusinessTravelTravel_Rarely       1    6806507 1237524835 10068
## - DistanceFromHome                  1    9613942 1240332270 10070
## - TotalWorkingYears                 1   32809205 1263527533 10083
## - JobLevel                          1 4272534581 5503252909 11107
## 
## Step:  AIC=10064.32
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldMedical + 
##     EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + MaritalStatusSingle + 
##     NumCompaniesWorked + OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - OverTimeYes                       1        825 1230719825 10062
## - NumCompaniesWorked                1      15006 1230734006 10062
## - JobSatisfaction                   1      18346 1230737346 10062
## - EducationFieldMedical             1      69553 1230788553 10062
## - `EducationFieldTechnical Degree`  1      98147 1230817147 10062
## - TrainingTimesLastYear             1     169979 1230888979 10062
## - YearsAtCompany                    1     370212 1231089212 10062
## - Age                               1     429997 1231148997 10063
## - YearsSinceLastPromotion           1     452836 1231171836 10063
## - BusinessTravelTravel_Frequently   1     480544 1231199544 10063
## - PercentSalaryHike                 1    1122063 1231841063 10063
## - GenderMale                        1    1599650 1232318651 10063
## - YearsInCurrentRole                1    2088138 1232807138 10064
## - MaritalStatusMarried              1    2482985 1233201985 10064
## - EducationFieldOther               1    2527658 1233246659 10064
## - MaritalStatusSingle               1    2572215 1233291215 10064
## - JobInvolvement                    1    2987757 1233706757 10064
## - EnvironmentSatisfaction           1    3152947 1233871947 10064
## <none>                                           1230719000 10064
## - YearsWithCurrManager              1    4191319 1234910319 10065
## - RelationshipSatisfaction          1    4434354 1235153354 10065
## - BusinessTravelTravel_Rarely       1    6807188 1237526188 10066
## - EducationFieldMarketing           1    7937453 1238656453 10067
## - DistanceFromHome                  1    9616939 1240335940 10068
## - TotalWorkingYears                 1   32815075 1263534075 10081
## - JobLevel                          1 4275320837 5506039838 11105
## 
## Step:  AIC=10062.32
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldMedical + 
##     EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + MaritalStatusSingle + 
##     NumCompaniesWorked + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - NumCompaniesWorked                1      14806 1230734631 10060
## - JobSatisfaction                   1      18124 1230737949 10060
## - EducationFieldMedical             1      70331 1230790156 10060
## - `EducationFieldTechnical Degree`  1      99167 1230818992 10060
## - TrainingTimesLastYear             1     169177 1230889002 10060
## - YearsAtCompany                    1     369387 1231089212 10060
## - Age                               1     429182 1231149007 10061
## - YearsSinceLastPromotion           1     452478 1231172303 10061
## - BusinessTravelTravel_Frequently   1     480153 1231199978 10061
## - PercentSalaryHike                 1    1121905 1231841730 10061
## - GenderMale                        1    1601453 1232321278 10061
## - YearsInCurrentRole                1    2087669 1232807494 10062
## - MaritalStatusMarried              1    2482202 1233202027 10062
## - EducationFieldOther               1    2527826 1233247651 10062
## - MaritalStatusSingle               1    2574586 1233294411 10062
## - JobInvolvement                    1    2989800 1233709625 10062
## - EnvironmentSatisfaction           1    3162101 1233881926 10062
## <none>                                           1230719825 10062
## - YearsWithCurrManager              1    4204999 1234924824 10063
## - RelationshipSatisfaction          1    4437533 1235157358 10063
## - BusinessTravelTravel_Rarely       1    6835230 1237555055 10064
## - EducationFieldMarketing           1    7938631 1238658456 10065
## - DistanceFromHome                  1    9730662 1240450488 10066
## - TotalWorkingYears                 1   32916103 1263635928 10079
## - JobLevel                          1 4276504945 5507224770 11103
## 
## Step:  AIC=10060.33
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldMedical + 
##     EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + MaritalStatusSingle + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - JobSatisfaction                   1      17382 1230752013 10058
## - EducationFieldMedical             1      69561 1230804192 10058
## - `EducationFieldTechnical Degree`  1     102352 1230836983 10058
## - TrainingTimesLastYear             1     172708 1230907339 10058
## - YearsAtCompany                    1     356697 1231091328 10058
## - YearsSinceLastPromotion           1     451411 1231186043 10059
## - Age                               1     451860 1231186492 10059
## - BusinessTravelTravel_Frequently   1     478036 1231212667 10059
## - PercentSalaryHike                 1    1123537 1231858168 10059
## - GenderMale                        1    1603601 1232338232 10059
## - YearsInCurrentRole                1    2105127 1232839758 10060
## - MaritalStatusMarried              1    2476022 1233210654 10060
## - EducationFieldOther               1    2513735 1233248366 10060
## - MaritalStatusSingle               1    2570247 1233304878 10060
## - JobInvolvement                    1    3015609 1233750240 10060
## - EnvironmentSatisfaction           1    3161222 1233895853 10060
## <none>                                           1230734631 10060
## - YearsWithCurrManager              1    4199677 1234934308 10061
## - RelationshipSatisfaction          1    4424918 1235159549 10061
## - BusinessTravelTravel_Rarely       1    6842822 1237577453 10062
## - EducationFieldMarketing           1    7930149 1238664780 10063
## - DistanceFromHome                  1    9717602 1240452233 10064
## - TotalWorkingYears                 1   35553244 1266287875 10078
## - JobLevel                          1 4312470388 5543205019 11106
## 
## Step:  AIC=10058.34
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldMedical + 
##     EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - EducationFieldMedical             1      67901 1230819914 10056
## - `EducationFieldTechnical Degree`  1     104633 1230856646 10056
## - TrainingTimesLastYear             1     177101 1230929114 10056
## - YearsAtCompany                    1     379905 1231131918 10057
## - Age                               1     459286 1231211299 10057
## - YearsSinceLastPromotion           1     463950 1231215963 10057
## - BusinessTravelTravel_Frequently   1     496382 1231248395 10057
## - PercentSalaryHike                 1    1122747 1231874760 10057
## - GenderMale                        1    1607639 1232359652 10057
## - YearsInCurrentRole                1    2092081 1232844094 10058
## - MaritalStatusMarried              1    2484283 1233236296 10058
## - EducationFieldOther               1    2516959 1233268972 10058
## - MaritalStatusSingle               1    2561759 1233313773 10058
## - JobInvolvement                    1    3041612 1233793625 10058
## - EnvironmentSatisfaction           1    3152005 1233904018 10058
## <none>                                           1230752013 10058
## - YearsWithCurrManager              1    4196024 1234948037 10059
## - RelationshipSatisfaction          1    4468223 1235220236 10059
## - BusinessTravelTravel_Rarely       1    6828256 1237580269 10060
## - EducationFieldMarketing           1    7942843 1238694856 10061
## - DistanceFromHome                  1    9715212 1240467225 10062
## - TotalWorkingYears                 1   35882618 1266634631 10076
## - JobLevel                          1 4313921593 5544673606 11104
## 
## Step:  AIC=10056.38
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     MaritalStatusSingle + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldTechnical Degree`  1     165021 1230984935 10054
## - TrainingTimesLastYear             1     200512 1231020426 10054
## - YearsAtCompany                    1     371463 1231191376 10055
## - YearsSinceLastPromotion           1     477455 1231297369 10055
## - Age                               1     480697 1231300611 10055
## - BusinessTravelTravel_Frequently   1     517722 1231337636 10055
## - PercentSalaryHike                 1    1116698 1231936612 10055
## - GenderMale                        1    1593474 1232413388 10055
## - YearsInCurrentRole                1    2107280 1232927194 10056
## - MaritalStatusMarried              1    2461761 1233281674 10056
## - MaritalStatusSingle               1    2544580 1233364494 10056
## - EducationFieldOther               1    2845851 1233665765 10056
## - JobInvolvement                    1    3040900 1233860814 10056
## - EnvironmentSatisfaction           1    3168694 1233988608 10056
## <none>                                           1230819914 10056
## - YearsWithCurrManager              1    4210911 1235030825 10057
## - RelationshipSatisfaction          1    4561324 1235381238 10057
## - BusinessTravelTravel_Rarely       1    6772345 1237592259 10058
## - EducationFieldMarketing           1    9191154 1240011068 10060
## - DistanceFromHome                  1    9661976 1240481890 10060
## - TotalWorkingYears                 1   36217479 1267037393 10075
## - JobLevel                          1 4330279596 5561099510 11104
## 
## Step:  AIC=10054.47
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldOther + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - TrainingTimesLastYear            1     195661 1231180596 10053
## - YearsAtCompany                   1     348235 1231333169 10053
## - YearsSinceLastPromotion          1     463528 1231448463 10053
## - Age                              1     505528 1231490463 10053
## - BusinessTravelTravel_Frequently  1     516017 1231500952 10053
## - PercentSalaryHike                1    1173623 1232158557 10053
## - GenderMale                       1    1620335 1232605270 10053
## - YearsInCurrentRole               1    2210294 1233195228 10054
## - MaritalStatusMarried             1    2410561 1233395495 10054
## - MaritalStatusSingle              1    2550117 1233535052 10054
## - EducationFieldOther              1    2749123 1233734058 10054
## - JobInvolvement                   1    3041615 1234026550 10054
## - EnvironmentSatisfaction          1    3223281 1234208216 10054
## <none>                                          1230984935 10054
## - YearsWithCurrManager             1    4235004 1235219939 10055
## - RelationshipSatisfaction         1    4569275 1235554209 10055
## - BusinessTravelTravel_Rarely      1    6814357 1237799292 10056
## - EducationFieldMarketing          1    9027242 1240012177 10058
## - DistanceFromHome                 1    9690065 1240675000 10058
## - TotalWorkingYears                1   36577602 1267562537 10073
## - JobLevel                         1 4331231551 5562216486 11102
## 
## Step:  AIC=10052.58
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldOther + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - YearsAtCompany                   1     311692 1231492288 10051
## - YearsSinceLastPromotion          1     433256 1231613853 10051
## - BusinessTravelTravel_Frequently  1     491733 1231672330 10051
## - Age                              1     498289 1231678885 10051
## - PercentSalaryHike                1    1192583 1232373179 10051
## - GenderMale                       1    1649676 1232830273 10052
## - YearsInCurrentRole               1    2276784 1233457380 10052
## - MaritalStatusMarried             1    2331973 1233512570 10052
## - MaritalStatusSingle              1    2492992 1233673588 10052
## - EducationFieldOther              1    2732761 1233913357 10052
## - JobInvolvement                   1    3017745 1234198341 10052
## - EnvironmentSatisfaction          1    3225181 1234405777 10052
## <none>                                          1231180596 10053
## - YearsWithCurrManager             1    4250097 1235430694 10053
## - RelationshipSatisfaction         1    4609802 1235790398 10053
## - BusinessTravelTravel_Rarely      1    6841052 1238021649 10054
## - EducationFieldMarketing          1    9087186 1240267782 10056
## - DistanceFromHome                 1    9851764 1241032360 10056
## - TotalWorkingYears                1   36428336 1267608932 10071
## - JobLevel                         1 4331701585 5562882181 11100
## 
## Step:  AIC=10050.76
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldOther + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - YearsSinceLastPromotion          1     252641 1231744929 10049
## - Age                              1     410541 1231902829 10049
## - BusinessTravelTravel_Frequently  1     495038 1231987326 10049
## - PercentSalaryHike                1    1197373 1232689661 10049
## - GenderMale                       1    1605489 1233097777 10050
## - MaritalStatusMarried             1    2351429 1233843717 10050
## - MaritalStatusSingle              1    2515913 1234008201 10050
## - EducationFieldOther              1    2637641 1234129929 10050
## - EnvironmentSatisfaction          1    3198822 1234691110 10051
## - JobInvolvement                   1    3280470 1234772758 10051
## - YearsInCurrentRole               1    3474216 1234966504 10051
## <none>                                          1231492288 10051
## - RelationshipSatisfaction         1    4541741 1236034029 10051
## - YearsWithCurrManager             1    6511278 1238003566 10052
## - BusinessTravelTravel_Rarely      1    6796797 1238289086 10053
## - EducationFieldMarketing          1    9038020 1240530308 10054
## - DistanceFromHome                 1    9690174 1241182462 10054
## - TotalWorkingYears                1   37667593 1269159881 10070
## - JobLevel                         1 4342473611 5573965899 11100
## 
## Step:  AIC=10048.9
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldOther + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - Age                              1     422603 1232167532 10047
## - BusinessTravelTravel_Frequently  1     491831 1232236760 10047
## - PercentSalaryHike                1    1122213 1232867143 10048
## - GenderMale                       1    1649855 1233394784 10048
## - MaritalStatusMarried             1    2427759 1234172688 10048
## - MaritalStatusSingle              1    2537992 1234282921 10048
## - EducationFieldOther              1    2689210 1234434139 10048
## - EnvironmentSatisfaction          1    3137588 1234882517 10049
## - JobInvolvement                   1    3187340 1234932269 10049
## - YearsInCurrentRole               1    3222501 1234967430 10049
## <none>                                          1231744929 10049
## - RelationshipSatisfaction         1    4646905 1236391834 10050
## - YearsWithCurrManager             1    6277887 1238022817 10050
## - BusinessTravelTravel_Rarely      1    6648513 1238393442 10051
## - EducationFieldMarketing          1    9128766 1240873695 10052
## - DistanceFromHome                 1    9682016 1241426945 10052
## - TotalWorkingYears                1   39911456 1271656385 10069
## - JobLevel                         1 4344881350 5576626279 11098
## 
## Step:  AIC=10047.14
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldOther + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - BusinessTravelTravel_Frequently  1     485817 1232653349 10045
## - PercentSalaryHike                1    1090290 1233257822 10046
## - GenderMale                       1    1675781 1233843313 10046
## - MaritalStatusMarried             1    2424140 1234591672 10046
## - EducationFieldOther              1    2581192 1234748723 10047
## - MaritalStatusSingle              1    2653875 1234821407 10047
## - YearsInCurrentRole               1    3029243 1235196775 10047
## - JobInvolvement                   1    3087524 1235255056 10047
## - EnvironmentSatisfaction          1    3169798 1235337330 10047
## <none>                                          1232167532 10047
## - RelationshipSatisfaction         1    4560281 1236727813 10048
## - YearsWithCurrManager             1    6099708 1238267240 10049
## - BusinessTravelTravel_Rarely      1    6673374 1238840906 10049
## - EducationFieldMarketing          1    9387213 1241554744 10050
## - DistanceFromHome                 1    9577478 1241745009 10050
## - TotalWorkingYears                1   50393960 1282561491 10073
## - JobLevel                         1 4376244013 5608411545 11100
## 
## Step:  AIC=10045.41
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + MaritalStatusSingle + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     YearsInCurrentRole + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - PercentSalaryHike            1    1078684 1233732033 10044
## - GenderMale                   1    1696277 1234349626 10044
## - MaritalStatusMarried         1    2323426 1234976775 10045
## - MaritalStatusSingle          1    2484692 1235138041 10045
## - EducationFieldOther          1    2647330 1235300678 10045
## - JobInvolvement               1    2931808 1235585157 10045
## - YearsInCurrentRole           1    3051507 1235704855 10045
## - EnvironmentSatisfaction      1    3317000 1235970348 10045
## <none>                                      1232653349 10045
## - RelationshipSatisfaction     1    4401726 1237055075 10046
## - YearsWithCurrManager         1    6098157 1238751506 10047
## - DistanceFromHome             1    9459060 1242112408 10049
## - EducationFieldMarketing      1    9564465 1242217814 10049
## - BusinessTravelTravel_Rarely  1   21255281 1253908629 10055
## - TotalWorkingYears            1   49957637 1282610986 10071
## - JobLevel                     1 4387091428 5619744776 11099
## 
## Step:  AIC=10044.02
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + MaritalStatusSingle + 
##     RelationshipSatisfaction + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - GenderMale                   1    1784123 1235516156 10043
## - MaritalStatusMarried         1    2322183 1236054216 10043
## - MaritalStatusSingle          1    2562764 1236294796 10044
## - EducationFieldOther          1    2572201 1236304234 10044
## - YearsInCurrentRole           1    2869837 1236601870 10044
## - JobInvolvement               1    2953650 1236685683 10044
## - EnvironmentSatisfaction      1    3276100 1237008132 10044
## <none>                                      1233732033 10044
## - RelationshipSatisfaction     1    4270003 1238002036 10044
## - YearsWithCurrManager         1    6349955 1240081988 10046
## - DistanceFromHome             1    9164527 1242896560 10047
## - EducationFieldMarketing      1    9915135 1243647167 10048
## - BusinessTravelTravel_Rarely  1   21287912 1255019944 10054
## - TotalWorkingYears            1   49679184 1283411217 10070
## - JobLevel                     1 4388770124 5622502157 11098
## 
## Step:  AIC=10043.03
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + JobInvolvement + 
##     JobLevel + MaritalStatusMarried + MaritalStatusSingle + RelationshipSatisfaction + 
##     TotalWorkingYears + YearsInCurrentRole + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - MaritalStatusMarried         1    1952067 1237468223 10042
## - MaritalStatusSingle          1    2225660 1237741815 10042
## - EducationFieldOther          1    2466315 1237982470 10042
## - JobInvolvement               1    3008879 1238525035 10043
## - YearsInCurrentRole           1    3037848 1238554003 10043
## - EnvironmentSatisfaction      1    3321165 1238837321 10043
## <none>                                      1235516156 10043
## - RelationshipSatisfaction     1    4272864 1239789019 10043
## - YearsWithCurrManager         1    6531585 1242047740 10045
## - DistanceFromHome             1    9075635 1244591790 10046
## - EducationFieldMarketing      1   10465422 1245981577 10047
## - BusinessTravelTravel_Rarely  1   21732904 1257249059 10053
## - TotalWorkingYears            1   49662332 1285178487 10068
## - JobLevel                     1 4387399306 5622915462 11096
## 
## Step:  AIC=10042.12
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + JobInvolvement + 
##     JobLevel + MaritalStatusSingle + RelationshipSatisfaction + 
##     TotalWorkingYears + YearsInCurrentRole + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - MaritalStatusSingle          1     597484 1238065707 10040
## - EducationFieldOther          1    2516904 1239985127 10042
## - JobInvolvement               1    2811681 1240279904 10042
## - YearsInCurrentRole           1    2828810 1240297033 10042
## - EnvironmentSatisfaction      1    3511238 1240979461 10042
## <none>                                      1237468223 10042
## - RelationshipSatisfaction     1    4024859 1241493082 10042
## - YearsWithCurrManager         1    6643297 1244111520 10044
## - DistanceFromHome             1    8642048 1246110271 10045
## - EducationFieldMarketing      1   10910361 1248378584 10046
## - BusinessTravelTravel_Rarely  1   22401240 1259869463 10053
## - TotalWorkingYears            1   49155097 1286623320 10067
## - JobLevel                     1 4387446753 5624914976 11094
## 
## Step:  AIC=10040.46
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + JobInvolvement + 
##     JobLevel + RelationshipSatisfaction + TotalWorkingYears + 
##     YearsInCurrentRole + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - EducationFieldOther          1    2482226 1240547933 10040
## - JobInvolvement               1    2638751 1240704458 10040
## - YearsInCurrentRole           1    3023136 1241088843 10040
## - EnvironmentSatisfaction      1    3514773 1241580480 10040
## <none>                                      1238065707 10040
## - RelationshipSatisfaction     1    4158477 1242224185 10041
## - YearsWithCurrManager         1    6515033 1244580740 10042
## - DistanceFromHome             1    9094014 1247159721 10044
## - EducationFieldMarketing      1   10781906 1248847613 10044
## - BusinessTravelTravel_Rarely  1   21999080 1260064787 10051
## - TotalWorkingYears            1   48856156 1286921863 10065
## - JobLevel                     1 4386968589 5625034296 11092
## 
## Step:  AIC=10039.85
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + RelationshipSatisfaction + 
##     TotalWorkingYears + YearsInCurrentRole + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - JobInvolvement               1    2821210 1243369143 10039
## - YearsInCurrentRole           1    3024127 1243572061 10040
## <none>                                      1240547933 10040
## - EnvironmentSatisfaction      1    3913881 1244461815 10040
## - RelationshipSatisfaction     1    4474067 1245022000 10040
## - YearsWithCurrManager         1    6660242 1247208176 10042
## - DistanceFromHome             1    9275460 1249823393 10043
## - EducationFieldMarketing      1    9887468 1250435401 10043
## - BusinessTravelTravel_Rarely  1   22280085 1262828019 10050
## - TotalWorkingYears            1   50919444 1291467377 10066
## - JobLevel                     1 4386539067 5627087001 11090
## 
## Step:  AIC=10039.44
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobLevel + RelationshipSatisfaction + 
##     TotalWorkingYears + YearsInCurrentRole + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - YearsInCurrentRole           1    2844717 1246213860 10039
## <none>                                      1243369143 10039
## - EnvironmentSatisfaction      1    4036945 1247406088 10040
## - RelationshipSatisfaction     1    4453707 1247822850 10040
## - YearsWithCurrManager         1    6808589 1250177733 10041
## - DistanceFromHome             1    9433031 1252802174 10043
## - EducationFieldMarketing      1   10249231 1253618374 10043
## - BusinessTravelTravel_Rarely  1   22788207 1266157350 10050
## - TotalWorkingYears            1   50213983 1293583126 10065
## - JobLevel                     1 4399320322 5642689465 11090
## 
## Step:  AIC=10039.03
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobLevel + RelationshipSatisfaction + 
##     TotalWorkingYears + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## <none>                                      1246213860 10039
## - RelationshipSatisfaction     1    4083982 1250297842 10039
## - EnvironmentSatisfaction      1    4529243 1250743103 10040
## - DistanceFromHome             1    9230164 1255444025 10042
## - EducationFieldMarketing      1   10286787 1256500647 10043
## - YearsWithCurrManager         1   20723334 1266937195 10048
## - BusinessTravelTravel_Rarely  1   21840375 1268054235 10049
## - TotalWorkingYears            1   47917600 1294131461 10063
## - JobLevel                     1 4399116634 5645330495 11088
## Start:  AIC=10078.65
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - RelationshipSatisfaction          1       9512 1225356217 10077
## - BusinessTravelTravel_Frequently   1      43077 1225389782 10077
## - OverTimeYes                       1      58138 1225404842 10077
## - JobSatisfaction                   1      60876 1225407581 10077
## - MaritalStatusSingle               1     101473 1225448178 10077
## - Age                               1     183841 1225530546 10077
## - Education                         1     223177 1225569882 10077
## - GenderMale                        1     254612 1225601316 10077
## - YearsInCurrentRole                1     773232 1226119936 10077
## - TrainingTimesLastYear             1     814432 1226161137 10077
## - NumCompaniesWorked                1     829734 1226176438 10077
## - EducationFieldOther               1     868497 1226215201 10077
## - PercentSalaryHike                 1    1053232 1226399937 10077
## - MaritalStatusMarried              1    1571889 1226918594 10078
## - EducationFieldMedical             1    1781364 1227128068 10078
## - `EducationFieldLife Sciences`     1    1797916 1227144621 10078
## - JobInvolvement                    1    1822665 1227169370 10078
## - YearsAtCompany                    1    2419841 1227766546 10078
## - `EducationFieldTechnical Degree`  1    2569807 1227916512 10078
## <none>                                           1225346705 10079
## - YearsSinceLastPromotion           1    3635105 1228981809 10079
## - EnvironmentSatisfaction           1    4216342 1229563046 10079
## - EducationFieldMarketing           1    6141062 1231487767 10080
## - BusinessTravelTravel_Rarely       1    6781730 1232128435 10080
## - YearsWithCurrManager              1   11376769 1236723474 10083
## - DistanceFromHome                  1   14943315 1240290020 10085
## - TotalWorkingYears                 1   32597761 1257944466 10095
## - JobLevel                          1 4259581424 5484928129 11121
## 
## Step:  AIC=10076.66
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - BusinessTravelTravel_Frequently   1      42969 1225399186 10075
## - OverTimeYes                       1      56964 1225413181 10075
## - JobSatisfaction                   1      62563 1225418780 10075
## - MaritalStatusSingle               1     100050 1225456267 10075
## - Age                               1     182116 1225538333 10075
## - Education                         1     222681 1225578898 10075
## - GenderMale                        1     253143 1225609360 10075
## - YearsInCurrentRole                1     777686 1226133904 10075
## - TrainingTimesLastYear             1     812375 1226168592 10075
## - NumCompaniesWorked                1     823631 1226179848 10075
## - EducationFieldOther               1     874776 1226230993 10075
## - PercentSalaryHike                 1    1043848 1226400065 10075
## - MaritalStatusMarried              1    1562828 1226919046 10076
## - EducationFieldMedical             1    1787298 1227143515 10076
## - `EducationFieldLife Sciences`     1    1813021 1227169238 10076
## - JobInvolvement                    1    1836920 1227193137 10076
## - YearsAtCompany                    1    2412058 1227768275 10076
## - `EducationFieldTechnical Degree`  1    2586951 1227943168 10076
## <none>                                           1225356217 10077
## - YearsSinceLastPromotion           1    3649966 1229006183 10077
## - EnvironmentSatisfaction           1    4210654 1229566871 10077
## - EducationFieldMarketing           1    6155819 1231512037 10078
## - BusinessTravelTravel_Rarely       1    6772218 1232128435 10078
## - YearsWithCurrManager              1   11381795 1236738012 10081
## - DistanceFromHome                  1   14937824 1240294041 10083
## - TotalWorkingYears                 1   32600064 1257956281 10093
## - JobLevel                          1 4260525609 5485881826 11119
## 
## Step:  AIC=10074.68
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + MaritalStatusSingle + 
##     NumCompaniesWorked + OverTimeYes + PercentSalaryHike + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - OverTimeYes                       1      61590 1225460776 10073
## - JobSatisfaction                   1      65568 1225464754 10073
## - MaritalStatusSingle               1     114692 1225513878 10073
## - Age                               1     175250 1225574436 10073
## - Education                         1     220320 1225619506 10073
## - GenderMale                        1     244364 1225643550 10073
## - YearsInCurrentRole                1     781020 1226180206 10073
## - TrainingTimesLastYear             1     790955 1226190141 10073
## - NumCompaniesWorked                1     805572 1226204758 10073
## - EducationFieldOther               1     880336 1226279521 10073
## - PercentSalaryHike                 1    1061772 1226460958 10073
## - MaritalStatusMarried              1    1537846 1226937032 10074
## - EducationFieldMedical             1    1785860 1227185046 10074
## - JobInvolvement                    1    1811824 1227211010 10074
## - `EducationFieldLife Sciences`     1    1815381 1227214567 10074
## - YearsAtCompany                    1    2401434 1227800620 10074
## - `EducationFieldTechnical Degree`  1    2582141 1227981327 10074
## <none>                                           1225399186 10075
## - YearsSinceLastPromotion           1    3640569 1229039755 10075
## - EnvironmentSatisfaction           1    4232331 1229631516 10075
## - EducationFieldMarketing           1    6171591 1231570777 10076
## - YearsWithCurrManager              1   11371764 1236770950 10079
## - DistanceFromHome                  1   14905440 1240304626 10081
## - BusinessTravelTravel_Rarely       1   17340031 1242739217 10082
## - TotalWorkingYears                 1   32607945 1258007130 10091
## - JobLevel                          1 4269425552 5494824738 11119
## 
## Step:  AIC=10072.72
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + MaritalStatusSingle + 
##     NumCompaniesWorked + PercentSalaryHike + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - JobSatisfaction                   1      65835 1225526611 10071
## - MaritalStatusSingle               1     110351 1225571128 10071
## - Age                               1     182188 1225642964 10071
## - Education                         1     233767 1225694544 10071
## - GenderMale                        1     243214 1225703990 10071
## - YearsInCurrentRole                1     768513 1226229289 10071
## - NumCompaniesWorked                1     800235 1226261011 10071
## - TrainingTimesLastYear             1     807054 1226267831 10071
## - EducationFieldOther               1     906634 1226367410 10071
## - PercentSalaryHike                 1    1082135 1226542911 10071
## - MaritalStatusMarried              1    1588376 1227049152 10072
## - EducationFieldMedical             1    1814954 1227275730 10072
## - JobInvolvement                    1    1828892 1227289668 10072
## - `EducationFieldLife Sciences`     1    1842474 1227303251 10072
## - YearsAtCompany                    1    2433530 1227894306 10072
## - `EducationFieldTechnical Degree`  1    2598977 1228059753 10072
## <none>                                           1225460776 10073
## - YearsSinceLastPromotion           1    3621529 1229082305 10073
## - EnvironmentSatisfaction           1    4330777 1229791553 10073
## - EducationFieldMarketing           1    6210131 1231670907 10074
## - YearsWithCurrManager              1   11326469 1236787245 10077
## - DistanceFromHome                  1   15132277 1240593053 10079
## - BusinessTravelTravel_Rarely       1   17305767 1242766543 10080
## - TotalWorkingYears                 1   32684595 1258145372 10089
## - JobLevel                          1 4269497518 5494958294 11117
## 
## Step:  AIC=10070.76
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - MaritalStatusSingle               1     120774 1225647386 10069
## - Age                               1     192928 1225719540 10069
## - Education                         1     222057 1225748668 10069
## - GenderMale                        1     255894 1225782505 10069
## - YearsInCurrentRole                1     756197 1226282808 10069
## - NumCompaniesWorked                1     763691 1226290303 10069
## - TrainingTimesLastYear             1     832192 1226358804 10069
## - EducationFieldOther               1     911200 1226437811 10069
## - PercentSalaryHike                 1    1073423 1226600035 10069
## - MaritalStatusMarried              1    1580919 1227107530 10070
## - EducationFieldMedical             1    1821847 1227348458 10070
## - `EducationFieldLife Sciences`     1    1847658 1227374269 10070
## - JobInvolvement                    1    1891152 1227417764 10070
## - YearsAtCompany                    1    2502192 1228028804 10070
## - `EducationFieldTechnical Degree`  1    2594411 1228121022 10070
## <none>                                           1225526611 10071
## - YearsSinceLastPromotion           1    3694008 1229220619 10071
## - EnvironmentSatisfaction           1    4346740 1229873351 10071
## - EducationFieldMarketing           1    6214773 1231741384 10072
## - YearsWithCurrManager              1   11326759 1236853370 10075
## - DistanceFromHome                  1   15104110 1240630721 10077
## - BusinessTravelTravel_Rarely       1   17554518 1243081130 10079
## - TotalWorkingYears                 1   32779717 1258306328 10087
## - JobLevel                          1 4272726048 5498252659 11115
## 
## Step:  AIC=10068.82
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + PercentSalaryHike + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Age                               1     178731 1225826117 10067
## - Education                         1     224995 1225872381 10067
## - GenderMale                        1     227854 1225875239 10067
## - YearsInCurrentRole                1     728897 1226376283 10067
## - NumCompaniesWorked                1     786145 1226433530 10067
## - TrainingTimesLastYear             1     828953 1226476338 10067
## - EducationFieldOther               1     939848 1226587234 10067
## - PercentSalaryHike                 1    1074027 1226721413 10067
## - EducationFieldMedical             1    1833847 1227481233 10068
## - `EducationFieldLife Sciences`     1    1861848 1227509234 10068
## - JobInvolvement                    1    1954572 1227601958 10068
## - YearsAtCompany                    1    2500465 1228147851 10068
## - `EducationFieldTechnical Degree`  1    2607057 1228254443 10068
## - MaritalStatusMarried              1    3485109 1229132494 10069
## <none>                                           1225647386 10069
## - YearsSinceLastPromotion           1    3682086 1229329472 10069
## - EnvironmentSatisfaction           1    4274126 1229921512 10069
## - EducationFieldMarketing           1    6254331 1231901717 10070
## - YearsWithCurrManager              1   11413005 1237060391 10073
## - DistanceFromHome                  1   15047632 1240695017 10075
## - BusinessTravelTravel_Rarely       1   17502711 1243150096 10077
## - TotalWorkingYears                 1   32967852 1258615238 10085
## - JobLevel                          1 4276966323 5502613709 11114
## 
## Step:  AIC=10066.93
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + Education + 
##     `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + PercentSalaryHike + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Education                         1     170354 1225996470 10065
## - GenderMale                        1     231486 1226057603 10065
## - YearsInCurrentRole                1     702593 1226528709 10065
## - NumCompaniesWorked                1     811991 1226638108 10065
## - TrainingTimesLastYear             1     826545 1226652662 10065
## - EducationFieldOther               1     920494 1226746611 10065
## - PercentSalaryHike                 1    1042956 1226869073 10066
## - EducationFieldMedical             1    1820467 1227646584 10066
## - `EducationFieldLife Sciences`     1    1872144 1227698260 10066
## - JobInvolvement                    1    1922403 1227748519 10066
## - YearsAtCompany                    1    2412175 1228238291 10066
## - `EducationFieldTechnical Degree`  1    2584678 1228410795 10066
## - MaritalStatusMarried              1    3427256 1229253373 10067
## <none>                                           1225826117 10067
## - YearsSinceLastPromotion           1    3672626 1229498742 10067
## - EnvironmentSatisfaction           1    4315417 1230141533 10067
## - EducationFieldMarketing           1    6276259 1232102375 10068
## - YearsWithCurrManager              1   11309087 1237135204 10071
## - DistanceFromHome                  1   15108348 1240934465 10074
## - BusinessTravelTravel_Rarely       1   17634474 1243460591 10075
## - TotalWorkingYears                 1   40473978 1266300095 10088
## - JobLevel                          1 4308464267 5534290383 11116
## 
## Step:  AIC=10065.02
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     NumCompaniesWorked + PercentSalaryHike + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - GenderMale                        1     219399 1226215870 10063
## - YearsInCurrentRole                1     701659 1226698129 10063
## - NumCompaniesWorked                1     731222 1226727693 10063
## - TrainingTimesLastYear             1     820409 1226816879 10064
## - EducationFieldOther               1     899227 1226895697 10064
## - PercentSalaryHike                 1    1040911 1227037381 10064
## - EducationFieldMedical             1    1810089 1227806559 10064
## - `EducationFieldLife Sciences`     1    1850340 1227846810 10064
## - JobInvolvement                    1    1956139 1227952609 10064
## - YearsAtCompany                    1    2462134 1228458604 10064
## - `EducationFieldTechnical Degree`  1    2563641 1228560111 10064
## - MaritalStatusMarried              1    3451982 1229448452 10065
## <none>                                           1225996470 10065
## - YearsSinceLastPromotion           1    3766570 1229763040 10065
## - EnvironmentSatisfaction           1    4357020 1230353490 10066
## - EducationFieldMarketing           1    6195851 1232192321 10066
## - YearsWithCurrManager              1   11160581 1237157051 10069
## - DistanceFromHome                  1   14951535 1240948005 10072
## - BusinessTravelTravel_Rarely       1   17753982 1243750453 10073
## - TotalWorkingYears                 1   40585044 1266581514 10086
## - JobLevel                          1 4315871632 5541868102 11114
## 
## Step:  AIC=10063.15
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsInCurrentRole                1     681361 1226897230 10062
## - NumCompaniesWorked                1     703712 1226919581 10062
## - TrainingTimesLastYear             1     858925 1227074794 10062
## - EducationFieldOther               1     881797 1227097666 10062
## - PercentSalaryHike                 1    1033607 1227249477 10062
## - EducationFieldMedical             1    1758981 1227974851 10062
## - `EducationFieldLife Sciences`     1    1795627 1228011497 10062
## - JobInvolvement                    1    1919522 1228135391 10062
## - YearsAtCompany                    1    2464398 1228680268 10062
## - `EducationFieldTechnical Degree`  1    2505406 1228721276 10063
## - MaritalStatusMarried              1    3480176 1229696046 10063
## <none>                                           1226215870 10063
## - YearsSinceLastPromotion           1    3727896 1229943766 10063
## - EnvironmentSatisfaction           1    4373984 1230589853 10064
## - EducationFieldMarketing           1    6094237 1232310107 10065
## - YearsWithCurrManager              1   11037148 1237253017 10067
## - DistanceFromHome                  1   14863392 1241079262 10070
## - BusinessTravelTravel_Rarely       1   17711439 1243927308 10071
## - TotalWorkingYears                 1   40563087 1266778956 10084
## - JobLevel                          1 4320632152 5546848022 11113
## 
## Step:  AIC=10061.54
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + NumCompaniesWorked + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - NumCompaniesWorked                1     705162 1227602393 10060
## - TrainingTimesLastYear             1     860623 1227757853 10060
## - EducationFieldOther               1     920252 1227817482 10060
## - PercentSalaryHike                 1     953693 1227850923 10060
## - JobInvolvement                    1    1780583 1228677814 10060
## - EducationFieldMedical             1    1785279 1228682509 10060
## - `EducationFieldLife Sciences`     1    1850922 1228748152 10061
## - `EducationFieldTechnical Degree`  1    2652790 1229550020 10061
## - MaritalStatusMarried              1    3284446 1230181677 10061
## - YearsSinceLastPromotion           1    3459535 1230356765 10062
## <none>                                           1226897230 10062
## - YearsAtCompany                    1    4418242 1231315472 10062
## - EnvironmentSatisfaction           1    4504991 1231402221 10062
## - EducationFieldMarketing           1    6182816 1233080046 10063
## - YearsWithCurrManager              1   13828422 1240725652 10067
## - DistanceFromHome                  1   14880134 1241777364 10068
## - BusinessTravelTravel_Rarely       1   17342256 1244239486 10069
## - TotalWorkingYears                 1   40657079 1267554309 10082
## - JobLevel                          1 4319977941 5546875171 11111
## 
## Step:  AIC=10059.94
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + PercentSalaryHike + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - EducationFieldOther               1     963928 1228566320 10058
## - TrainingTimesLastYear             1     979636 1228582029 10058
## - PercentSalaryHike                 1    1028678 1228631071 10058
## - JobInvolvement                    1    1756249 1229358642 10059
## - EducationFieldMedical             1    1887134 1229489526 10059
## - `EducationFieldLife Sciences`     1    1955764 1229558156 10059
## - `EducationFieldTechnical Degree`  1    2762518 1230364911 10060
## - MaritalStatusMarried              1    3234432 1230836824 10060
## <none>                                           1227602393 10060
## - YearsSinceLastPromotion           1    3572971 1231175364 10060
## - YearsAtCompany                    1    3775132 1231377525 10060
## - EnvironmentSatisfaction           1    4755849 1232358242 10061
## - EducationFieldMarketing           1    6272088 1233874481 10062
## - YearsWithCurrManager              1   13884518 1241486911 10066
## - DistanceFromHome                  1   14368236 1241970629 10066
## - BusinessTravelTravel_Rarely       1   18067959 1245670351 10068
## - TotalWorkingYears                 1   44098227 1271700619 10082
## - JobLevel                          1 4383336186 5610938579 11117
## 
## Step:  AIC=10058.48
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - TrainingTimesLastYear             1     908343 1229474663 10057
## - PercentSalaryHike                 1     969804 1229536124 10057
## - EducationFieldMedical             1    1051778 1229618098 10057
## - `EducationFieldLife Sciences`     1    1177491 1229743811 10057
## - JobInvolvement                    1    1780125 1230346445 10058
## - `EducationFieldTechnical Degree`  1    2141965 1230708285 10058
## - YearsSinceLastPromotion           1    3411045 1231977366 10058
## - MaritalStatusMarried              1    3509431 1232075751 10058
## <none>                                           1228566320 10058
## - YearsAtCompany                    1    3618727 1232185047 10058
## - EnvironmentSatisfaction           1    4841504 1233407825 10059
## - EducationFieldMarketing           1    8884592 1237450913 10062
## - YearsWithCurrManager              1   14077163 1242643483 10064
## - DistanceFromHome                  1   14553060 1243119380 10065
## - BusinessTravelTravel_Rarely       1   17616895 1246183215 10066
## - TotalWorkingYears                 1   44274722 1272841042 10081
## - JobLevel                          1 4383865495 5612431815 11115
## 
## Step:  AIC=10057
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + TotalWorkingYears + YearsAtCompany + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - EducationFieldMedical             1     953907 1230428571 10056
## - PercentSalaryHike                 1     964244 1230438908 10056
## - `EducationFieldLife Sciences`     1    1203301 1230677964 10056
## - JobInvolvement                    1    1717595 1231192258 10056
## - `EducationFieldTechnical Degree`  1    2111135 1231585799 10056
## - YearsSinceLastPromotion           1    3183477 1232658140 10057
## - YearsAtCompany                    1    3340853 1232815516 10057
## - MaritalStatusMarried              1    3385314 1232859978 10057
## <none>                                           1229474663 10057
## - EnvironmentSatisfaction           1    4888674 1234363337 10058
## - EducationFieldMarketing           1    8802156 1238276819 10060
## - YearsWithCurrManager              1   14288600 1243763263 10063
## - DistanceFromHome                  1   14976187 1244450850 10063
## - BusinessTravelTravel_Rarely       1   17426697 1246901360 10065
## - TotalWorkingYears                 1   43920857 1273395520 10080
## - JobLevel                          1 4385486786 5614961450 11114
## 
## Step:  AIC=10055.54
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + TotalWorkingYears + YearsAtCompany + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldLife Sciences`     1     265744 1230694315 10054
## - PercentSalaryHike                 1     973064 1231401635 10054
## - `EducationFieldTechnical Degree`  1    1158186 1231586757 10054
## - JobInvolvement                    1    1628384 1232056955 10054
## - YearsSinceLastPromotion           1    2929580 1233358151 10055
## - YearsAtCompany                    1    3338543 1233767114 10055
## - MaritalStatusMarried              1    3498295 1233926866 10056
## <none>                                           1230428571 10056
## - EnvironmentSatisfaction           1    4540503 1234969074 10056
## - EducationFieldMarketing           1   10268118 1240696689 10059
## - YearsWithCurrManager              1   14283428 1244711999 10062
## - DistanceFromHome                  1   15248132 1245676703 10062
## - BusinessTravelTravel_Rarely       1   17678811 1248107382 10064
## - TotalWorkingYears                 1   43619141 1274047712 10078
## - JobLevel                          1 4405095589 5635524160 11114
## 
## Step:  AIC=10053.69
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + PercentSalaryHike + 
##     TotalWorkingYears + YearsAtCompany + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldTechnical Degree`  1     924306 1231618621 10052
## - PercentSalaryHike                 1     968036 1231662350 10052
## - JobInvolvement                    1    1587369 1232281684 10053
## - YearsSinceLastPromotion           1    2844055 1233538370 10053
## - YearsAtCompany                    1    3228481 1233922796 10054
## - MaritalStatusMarried              1    3530158 1234224473 10054
## <none>                                           1230694315 10054
## - EnvironmentSatisfaction           1    4509470 1235203785 10054
## - EducationFieldMarketing           1   10493438 1241187753 10058
## - YearsWithCurrManager              1   14353323 1245047638 10060
## - DistanceFromHome                  1   15081529 1245775843 10060
## - BusinessTravelTravel_Rarely       1   17495992 1248190307 10062
## - TotalWorkingYears                 1   43823784 1274518099 10076
## - JobLevel                          1 4407919569 5638613884 11113
## 
## Step:  AIC=10052.21
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + TotalWorkingYears + YearsAtCompany + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - PercentSalaryHike            1    1161749 1232780370 10051
## - JobInvolvement               1    1622411 1233241032 10051
## - YearsSinceLastPromotion      1    2682225 1234300846 10052
## - YearsAtCompany               1    3122817 1234741439 10052
## - MaritalStatusMarried         1    3419996 1235038617 10052
## <none>                                      1231618621 10052
## - EnvironmentSatisfaction      1    4681689 1236300311 10053
## - EducationFieldMarketing      1    9926499 1241545120 10056
## - YearsWithCurrManager         1   14371394 1245990016 10058
## - DistanceFromHome             1   14853143 1246471764 10059
## - BusinessTravelTravel_Rarely  1   17552023 1249170644 10060
## - TotalWorkingYears            1   44209658 1275828279 10075
## - JobLevel                     1 4409168896 5640787517 11111
## 
## Step:  AIC=10050.87
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsAtCompany + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - JobInvolvement               1    1686556 1234466926 10050
## - YearsSinceLastPromotion      1    2451222 1235231592 10050
## - YearsAtCompany               1    3053512 1235833882 10051
## - MaritalStatusMarried         1    3469852 1236250222 10051
## <none>                                      1232780370 10051
## - EnvironmentSatisfaction      1    4565087 1237345457 10051
## - EducationFieldMarketing      1   10073286 1242853656 10054
## - YearsWithCurrManager         1   14230192 1247010562 10057
## - DistanceFromHome             1   14380086 1247160456 10057
## - BusinessTravelTravel_Rarely  1   17370626 1250150996 10059
## - TotalWorkingYears            1   44290321 1277070691 10074
## - JobLevel                     1 4415857410 5648637780 11110
## 
## Step:  AIC=10049.82
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsAtCompany + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - YearsSinceLastPromotion      1    2431504 1236898430 10049
## - YearsAtCompany               1    3397454 1237864380 10050
## <none>                                      1234466926 10050
## - MaritalStatusMarried         1    3590153 1238057079 10050
## - EnvironmentSatisfaction      1    4539765 1239006691 10050
## - EducationFieldMarketing      1   10313195 1244780121 10054
## - YearsWithCurrManager         1   13613265 1248080191 10056
## - DistanceFromHome             1   14381813 1248848739 10056
## - BusinessTravelTravel_Rarely  1   17456728 1251923654 10058
## - TotalWorkingYears            1   44201590 1278668516 10072
## - JobLevel                     1 4418395701 5652862627 11108
## 
## Step:  AIC=10049.19
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsAtCompany + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - YearsAtCompany               1    1796272 1238694702 10048
## <none>                                      1236898430 10049
## - MaritalStatusMarried         1    3891443 1240789872 10049
## - EnvironmentSatisfaction      1    4184488 1241082917 10050
## - EducationFieldMarketing      1   10143561 1247041991 10053
## - YearsWithCurrManager         1   12941891 1249840321 10054
## - DistanceFromHome             1   14458302 1251356731 10055
## - BusinessTravelTravel_Rarely  1   16506919 1253405349 10056
## - TotalWorkingYears            1   46671888 1283570317 10073
## - JobLevel                     1 4427716266 5664614696 11108
## 
## Step:  AIC=10048.21
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## <none>                                      1238694702 10048
## - MaritalStatusMarried         1    3741481 1242436183 10048
## - EnvironmentSatisfaction      1    4239550 1242934251 10049
## - EducationFieldMarketing      1   10178251 1248872953 10052
## - DistanceFromHome             1   14289485 1252984187 10054
## - BusinessTravelTravel_Rarely  1   16682468 1255377170 10056
## - YearsWithCurrManager         1   36778759 1275473461 10067
## - TotalWorkingYears            1   46032035 1284726737 10072
## - JobLevel                     1 4429811229 5668505931 11106
## Start:  AIC=10093.29
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - NumCompaniesWorked                1        567 1275674959 10091
## - JobSatisfaction                   1        754 1275675147 10091
## - Education                         1      40979 1275715371 10091
## - YearsInCurrentRole                1      42926 1275717319 10091
## - OverTimeYes                       1      66379 1275740771 10091
## - RelationshipSatisfaction          1      74957 1275749350 10091
## - YearsSinceLastPromotion           1     150934 1275825327 10091
## - BusinessTravelTravel_Frequently   1     291468 1275965860 10091
## - EducationFieldOther               1     294543 1275968935 10091
## - `EducationFieldTechnical Degree`  1     323465 1275997858 10092
## - `EducationFieldLife Sciences`     1     439284 1276113677 10092
## - TrainingTimesLastYear             1     543416 1276217808 10092
## - GenderMale                        1     557995 1276232387 10092
## - MaritalStatusSingle               1     687222 1276361615 10092
## - EducationFieldMedical             1     775477 1276449870 10092
## - PercentSalaryHike                 1     787442 1276461835 10092
## - Age                               1    1443440 1277117832 10092
## - YearsAtCompany                    1    1685662 1277360055 10092
## - MaritalStatusMarried              1    1846636 1277521029 10092
## - EnvironmentSatisfaction           1    2355196 1278029588 10093
## - EducationFieldMarketing           1    2497969 1278172362 10093
## <none>                                           1275674393 10093
## - JobInvolvement                    1    5844796 1281519188 10094
## - YearsWithCurrManager              1    7745926 1283420318 10096
## - BusinessTravelTravel_Rarely       1    8344198 1284018591 10096
## - DistanceFromHome                  1   12373010 1288047403 10098
## - TotalWorkingYears                 1   45892502 1321566894 10116
## - JobLevel                          1 4412830916 5688505308 11132
## 
## Step:  AIC=10091.29
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - JobSatisfaction                   1        706 1275675666 10089
## - Education                         1      42833 1275717793 10089
## - YearsInCurrentRole                1      43754 1275718713 10089
## - OverTimeYes                       1      66426 1275741385 10089
## - RelationshipSatisfaction          1      76973 1275751933 10089
## - YearsSinceLastPromotion           1     152555 1275827514 10089
## - BusinessTravelTravel_Frequently   1     291484 1275966444 10089
## - EducationFieldOther               1     294335 1275969295 10089
## - `EducationFieldTechnical Degree`  1     322985 1275997944 10090
## - `EducationFieldLife Sciences`     1     438789 1276113749 10090
## - TrainingTimesLastYear             1     542916 1276217875 10090
## - GenderMale                        1     558373 1276233333 10090
## - MaritalStatusSingle               1     686974 1276361934 10090
## - EducationFieldMedical             1     774938 1276449898 10090
## - PercentSalaryHike                 1     786932 1276461891 10090
## - Age                               1    1447573 1277122532 10090
## - YearsAtCompany                    1    1803232 1277478191 10090
## - MaritalStatusMarried              1    1849994 1277524954 10090
## - EnvironmentSatisfaction           1    2355007 1278029967 10091
## - EducationFieldMarketing           1    2497480 1278172439 10091
## <none>                                           1275674959 10091
## - JobInvolvement                    1    5850598 1281525557 10092
## - YearsWithCurrManager              1    7762643 1283437602 10094
## - BusinessTravelTravel_Rarely       1    8397158 1284072117 10094
## - DistanceFromHome                  1   12481878 1288156837 10096
## - TotalWorkingYears                 1   50320575 1325995534 10116
## - JobLevel                          1 4432437696 5708112656 11132
## 
## Step:  AIC=10089.29
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     MaritalStatusSingle + OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Education                         1      42998 1275718664 10087
## - YearsInCurrentRole                1      43661 1275719327 10087
## - OverTimeYes                       1      66625 1275742291 10087
## - RelationshipSatisfaction          1      76635 1275752300 10087
## - YearsSinceLastPromotion           1     153973 1275829638 10087
## - EducationFieldOther               1     293676 1275969342 10087
## - BusinessTravelTravel_Frequently   1     294646 1275970311 10087
## - `EducationFieldTechnical Degree`  1     322821 1275998487 10088
## - `EducationFieldLife Sciences`     1     438090 1276113756 10088
## - TrainingTimesLastYear             1     542222 1276217888 10088
## - GenderMale                        1     559293 1276234958 10088
## - MaritalStatusSingle               1     687451 1276363116 10088
## - EducationFieldMedical             1     774238 1276449904 10088
## - PercentSalaryHike                 1     786478 1276462144 10088
## - Age                               1    1446910 1277122575 10088
## - YearsAtCompany                    1    1808965 1277484631 10088
## - MaritalStatusMarried              1    1856490 1277532155 10088
## - EnvironmentSatisfaction           1    2356607 1278032273 10089
## - EducationFieldMarketing           1    2496788 1278172453 10089
## <none>                                           1275675666 10089
## - JobInvolvement                    1    5857310 1281532976 10090
## - YearsWithCurrManager              1    7764198 1283439864 10092
## - BusinessTravelTravel_Rarely       1    8396578 1284072243 10092
## - DistanceFromHome                  1   12495318 1288170984 10094
## - TotalWorkingYears                 1   50398441 1326074107 10114
## - JobLevel                          1 4437355244 5713030909 11131
## 
## Step:  AIC=10087.31
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsInCurrentRole                1      42318 1275760982 10085
## - OverTimeYes                       1      68490 1275787153 10085
## - RelationshipSatisfaction          1      76374 1275795038 10085
## - YearsSinceLastPromotion           1     145347 1275864011 10085
## - BusinessTravelTravel_Frequently   1     290768 1276009432 10086
## - EducationFieldOther               1     293358 1276012022 10086
## - `EducationFieldTechnical Degree`  1     327194 1276045858 10086
## - `EducationFieldLife Sciences`     1     440914 1276159577 10086
## - TrainingTimesLastYear             1     536298 1276254962 10086
## - GenderMale                        1     558110 1276276774 10086
## - MaritalStatusSingle               1     691018 1276409682 10086
## - EducationFieldMedical             1     780915 1276499578 10086
## - PercentSalaryHike                 1     784111 1276502774 10086
## - Age                               1    1405285 1277123949 10086
## - MaritalStatusMarried              1    1844554 1277563217 10086
## - YearsAtCompany                    1    1844697 1277563361 10086
## - EnvironmentSatisfaction           1    2411863 1278130527 10087
## - EducationFieldMarketing           1    2485399 1278204063 10087
## <none>                                           1275718664 10087
## - JobInvolvement                    1    5923318 1281641982 10088
## - YearsWithCurrManager              1    7722890 1283441554 10090
## - BusinessTravelTravel_Rarely       1    8409220 1284127883 10090
## - DistanceFromHome                  1   12452345 1288171009 10092
## - TotalWorkingYears                 1   50415819 1326134483 10112
## - JobLevel                          1 4439208778 5714927442 11129
## 
## Step:  AIC=10085.34
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - OverTimeYes                       1      69596 1275830578 10083
## - RelationshipSatisfaction          1      76368 1275837349 10083
## - YearsSinceLastPromotion           1     126844 1275887826 10083
## - EducationFieldOther               1     286014 1276046996 10084
## - BusinessTravelTravel_Frequently   1     294925 1276055907 10084
## - `EducationFieldTechnical Degree`  1     319726 1276080708 10084
## - `EducationFieldLife Sciences`     1     430437 1276191419 10084
## - TrainingTimesLastYear             1     529844 1276290826 10084
## - GenderMale                        1     543957 1276304939 10084
## - MaritalStatusSingle               1     732164 1276493146 10084
## - PercentSalaryHike                 1     769687 1276530669 10084
## - EducationFieldMedical             1     771805 1276532787 10084
## - Age                               1    1412162 1277173144 10084
## - MaritalStatusMarried              1    1843496 1277604478 10084
## - YearsAtCompany                    1    1905174 1277666156 10084
## - EnvironmentSatisfaction           1    2375082 1278136064 10085
## - EducationFieldMarketing           1    2469516 1278230498 10085
## <none>                                           1275760982 10085
## - JobInvolvement                    1    5919449 1281680431 10087
## - YearsWithCurrManager              1    8187322 1283948304 10088
## - BusinessTravelTravel_Rarely       1    8436744 1284197726 10088
## - DistanceFromHome                  1   12420866 1288181848 10090
## - TotalWorkingYears                 1   50463442 1326224424 10110
## - JobLevel                          1 4441843608 5717604590 11127
## 
## Step:  AIC=10083.37
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - RelationshipSatisfaction          1      74172 1275904750 10081
## - YearsSinceLastPromotion           1     128817 1275959394 10081
## - EducationFieldOther               1     271335 1276101913 10082
## - BusinessTravelTravel_Frequently   1     314031 1276144609 10082
## - `EducationFieldTechnical Degree`  1     314303 1276144881 10082
## - `EducationFieldLife Sciences`     1     418337 1276248915 10082
## - TrainingTimesLastYear             1     502036 1276332614 10082
## - GenderMale                        1     537840 1276368418 10082
## - MaritalStatusSingle               1     716376 1276546954 10082
## - EducationFieldMedical             1     753009 1276583587 10082
## - PercentSalaryHike                 1     780296 1276610873 10082
## - Age                               1    1392019 1277222597 10082
## - MaritalStatusMarried              1    1844806 1277675384 10082
## - YearsAtCompany                    1    1909031 1277739609 10082
## - EnvironmentSatisfaction           1    2347619 1278178197 10083
## - EducationFieldMarketing           1    2446203 1278276780 10083
## <none>                                           1275830578 10083
## - JobInvolvement                    1    5888407 1281718984 10085
## - YearsWithCurrManager              1    8213948 1284044526 10086
## - BusinessTravelTravel_Rarely       1    8540044 1284370621 10086
## - DistanceFromHome                  1   12362703 1288193281 10088
## - TotalWorkingYears                 1   50419489 1326250067 10108
## - JobLevel                          1 4442699144 5718529721 11126
## 
## Step:  AIC=10081.41
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsSinceLastPromotion           1     121279 1276026029 10080
## - EducationFieldOther               1     290451 1276195201 10080
## - `EducationFieldTechnical Degree`  1     336560 1276241310 10080
## - BusinessTravelTravel_Frequently   1     337362 1276242112 10080
## - `EducationFieldLife Sciences`     1     448036 1276352786 10080
## - TrainingTimesLastYear             1     511765 1276416515 10080
## - GenderMale                        1     540688 1276445438 10080
## - MaritalStatusSingle               1     707115 1276611865 10080
## - EducationFieldMedical             1     779100 1276683850 10080
## - PercentSalaryHike                 1     815874 1276720624 10080
## - Age                               1    1364328 1277269077 10080
## - MaritalStatusMarried              1    1816042 1277720792 10080
## - YearsAtCompany                    1    1904801 1277809551 10080
## - EnvironmentSatisfaction           1    2364572 1278269322 10081
## - EducationFieldMarketing           1    2516009 1278420759 10081
## <none>                                           1275904750 10081
## - JobInvolvement                    1    5934174 1281838924 10083
## - YearsWithCurrManager              1    8263050 1284167800 10084
## - BusinessTravelTravel_Rarely       1    8590061 1284494811 10084
## - DistanceFromHome                  1   12293148 1288197898 10086
## - TotalWorkingYears                 1   50354061 1326258811 10106
## - JobLevel                          1 4447683473 5723588223 11124
## 
## Step:  AIC=10079.48
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - EducationFieldOther               1     302414 1276328443 10078
## - BusinessTravelTravel_Frequently   1     326624 1276352653 10078
## - `EducationFieldTechnical Degree`  1     357312 1276383340 10078
## - `EducationFieldLife Sciences`     1     462781 1276488809 10078
## - GenderMale                        1     528120 1276554148 10078
## - TrainingTimesLastYear             1     554619 1276580647 10078
## - MaritalStatusSingle               1     718108 1276744137 10078
## - PercentSalaryHike                 1     799986 1276826015 10078
## - EducationFieldMedical             1     803785 1276829814 10078
## - Age                               1    1354166 1277380195 10078
## - MaritalStatusMarried              1    1790388 1277816417 10078
## - EnvironmentSatisfaction           1    2381286 1278407315 10079
## - EducationFieldMarketing           1    2553594 1278579623 10079
## - YearsAtCompany                    1    2823398 1278849427 10079
## <none>                                           1276026029 10080
## - JobInvolvement                    1    5972010 1281998038 10081
## - YearsWithCurrManager              1    8273213 1284299242 10082
## - BusinessTravelTravel_Rarely       1    8585394 1284611423 10082
## - DistanceFromHome                  1   12239554 1288265583 10084
## - TotalWorkingYears                 1   50284344 1326310373 10104
## - JobLevel                          1 4472356180 5748382209 11125
## 
## Step:  AIC=10077.64
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldTechnical Degree`  1      70029 1276398472 10076
## - `EducationFieldLife Sciences`     1     165110 1276493553 10076
## - BusinessTravelTravel_Frequently   1     326460 1276654903 10076
## - GenderMale                        1     530965 1276859409 10076
## - TrainingTimesLastYear             1     545656 1276874099 10076
## - EducationFieldMedical             1     671231 1276999674 10076
## - MaritalStatusSingle               1     762522 1277090965 10076
## - PercentSalaryHike                 1     821856 1277150299 10076
## - Age                               1    1333158 1277661602 10076
## - MaritalStatusMarried              1    1824280 1278152723 10077
## - EnvironmentSatisfaction           1    2454341 1278782784 10077
## - YearsAtCompany                    1    2746793 1279075236 10077
## <none>                                           1276328443 10078
## - EducationFieldMarketing           1    3899234 1280227677 10078
## - JobInvolvement                    1    6001625 1282330068 10079
## - YearsWithCurrManager              1    8440562 1284769005 10080
## - BusinessTravelTravel_Rarely       1    8518109 1284846552 10080
## - DistanceFromHome                  1   12379509 1288707952 10082
## - TotalWorkingYears                 1   50218809 1326547252 10102
## - JobLevel                          1 4474024221 5750352664 11123
## 
## Step:  AIC=10075.68
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + MaritalStatusSingle + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - `EducationFieldLife Sciences`    1      95101 1276493573 10074
## - BusinessTravelTravel_Frequently  1     326100 1276724572 10074
## - TrainingTimesLastYear            1     534173 1276932644 10074
## - GenderMale                       1     546054 1276944526 10074
## - EducationFieldMedical            1     699615 1277098087 10074
## - MaritalStatusSingle              1     766245 1277164717 10074
## - PercentSalaryHike                1     796908 1277195380 10074
## - Age                              1    1355388 1277753860 10074
## - MaritalStatusMarried             1    1815309 1278213781 10075
## - EnvironmentSatisfaction          1    2424964 1278823436 10075
## - YearsAtCompany                   1    2751268 1279149740 10075
## <none>                                          1276398472 10076
## - EducationFieldMarketing          1    4684741 1281083213 10076
## - JobInvolvement                   1    5965355 1282363827 10077
## - YearsWithCurrManager             1    8485075 1284883546 10078
## - BusinessTravelTravel_Rarely      1    8524037 1284922509 10078
## - DistanceFromHome                 1   12330312 1288728783 10080
## - TotalWorkingYears                1   50306795 1326705267 10101
## - JobLevel                         1 4476165973 5752564445 11122
## 
## Step:  AIC=10073.74
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + EducationFieldMarketing + EducationFieldMedical + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - BusinessTravelTravel_Frequently  1     322398 1276815970 10072
## - GenderMale                       1     547002 1277040575 10072
## - TrainingTimesLastYear            1     577472 1277071045 10072
## - EducationFieldMedical            1     726879 1277220452 10072
## - MaritalStatusSingle              1     765834 1277259407 10072
## - PercentSalaryHike                1     826212 1277319785 10072
## - Age                              1    1418665 1277912238 10072
## - MaritalStatusMarried             1    1847965 1278341537 10073
## - EnvironmentSatisfaction          1    2366333 1278859906 10073
## - YearsAtCompany                   1    2801036 1279294609 10073
## <none>                                          1276493573 10074
## - EducationFieldMarketing          1    5617919 1282111492 10075
## - JobInvolvement                   1    5906821 1282400394 10075
## - BusinessTravelTravel_Rarely      1    8480623 1284974196 10076
## - YearsWithCurrManager             1    8484190 1284977763 10076
## - DistanceFromHome                 1   12321821 1288815394 10078
## - TotalWorkingYears                1   50528253 1327021826 10099
## - JobLevel                         1 4477243511 5753737084 11120
## 
## Step:  AIC=10071.91
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldMedical + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     MaritalStatusSingle + PercentSalaryHike + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - GenderMale                   1     537666 1277353636 10070
## - TrainingTimesLastYear        1     625883 1277441853 10070
## - MaritalStatusSingle          1     679532 1277495503 10070
## - EducationFieldMedical        1     768557 1277584527 10070
## - PercentSalaryHike            1     839022 1277654992 10070
## - Age                          1    1454532 1278270502 10071
## - MaritalStatusMarried         1    1960110 1278776080 10071
## - EnvironmentSatisfaction      1    2370305 1279186276 10071
## - YearsAtCompany               1    2764410 1279580380 10071
## <none>                                      1276815970 10072
## - EducationFieldMarketing      1    5600074 1282416045 10073
## - JobInvolvement               1    6046061 1282862032 10073
## - YearsWithCurrManager         1    8614142 1285430112 10075
## - DistanceFromHome             1   12325441 1289141412 10077
## - BusinessTravelTravel_Rarely  1   13208216 1290024187 10077
## - TotalWorkingYears            1   50883686 1327699656 10097
## - JobLevel                     1 4477400542 5754216512 11118
## 
## Step:  AIC=10070.2
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldMedical + EnvironmentSatisfaction + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + MaritalStatusSingle + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - TrainingTimesLastYear        1     665742 1278019378 10069
## - MaritalStatusSingle          1     774715 1278128351 10069
## - EducationFieldMedical        1     813374 1278167010 10069
## - PercentSalaryHike            1     893548 1278247184 10069
## - Age                          1    1508119 1278861755 10069
## - MaritalStatusMarried         1    1793186 1279146822 10069
## - EnvironmentSatisfaction      1    2334704 1279688341 10070
## - YearsAtCompany               1    2779441 1280133078 10070
## <none>                                      1277353636 10070
## - EducationFieldMarketing      1    5788806 1283142442 10071
## - JobInvolvement               1    6260662 1283614299 10072
## - YearsWithCurrManager         1    8817358 1286170994 10073
## - DistanceFromHome             1   12444705 1289798341 10075
## - BusinessTravelTravel_Rarely  1   13262531 1290616168 10075
## - TotalWorkingYears            1   50984591 1328338227 10095
## - JobLevel                     1 4476922205 5754275842 11116
## 
## Step:  AIC=10068.57
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldMedical + EnvironmentSatisfaction + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + MaritalStatusSingle + 
##     PercentSalaryHike + TotalWorkingYears + YearsAtCompany + 
##     YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - EducationFieldMedical        1     671331 1278690709 10067
## - MaritalStatusSingle          1     783509 1278802887 10067
## - PercentSalaryHike            1     864317 1278883695 10067
## - Age                          1    1549474 1279568852 10067
## - MaritalStatusMarried         1    1831417 1279850795 10068
## - EnvironmentSatisfaction      1    2314657 1280334035 10068
## - YearsAtCompany               1    2743682 1280763060 10068
## <none>                                      1278019378 10069
## - EducationFieldMarketing      1    5650632 1283670010 10070
## - JobInvolvement               1    6255646 1284275024 10070
## - YearsWithCurrManager         1    8766245 1286785623 10071
## - DistanceFromHome             1   12540949 1290560327 10073
## - BusinessTravelTravel_Rarely  1   13090731 1291110109 10074
## - TotalWorkingYears            1   51158048 1329177426 10094
## - JobLevel                     1 4483432139 5761451516 11115
## 
## Step:  AIC=10066.93
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     EducationFieldMarketing + EnvironmentSatisfaction + JobInvolvement + 
##     JobLevel + MaritalStatusMarried + MaritalStatusSingle + PercentSalaryHike + 
##     TotalWorkingYears + YearsAtCompany + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - MaritalStatusSingle          1     750410 1279441119 10065
## - PercentSalaryHike            1     960579 1279651288 10066
## - Age                          1    1498052 1280188761 10066
## - MaritalStatusMarried         1    1885557 1280576267 10066
## - EnvironmentSatisfaction      1    2311849 1281002558 10066
## - YearsAtCompany               1    2967421 1281658131 10066
## <none>                                      1278690709 10067
## - EducationFieldMarketing      1    5064803 1283755512 10068
## - JobInvolvement               1    6273880 1284964589 10068
## - YearsWithCurrManager         1    8484481 1287175190 10070
## - DistanceFromHome             1   12956134 1291646843 10072
## - BusinessTravelTravel_Rarely  1   13280349 1291971058 10072
## - TotalWorkingYears            1   50580130 1329270839 10092
## - JobLevel                     1 4506403406 5785094116 11116
## 
## Step:  AIC=10065.34
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     EducationFieldMarketing + EnvironmentSatisfaction + JobInvolvement + 
##     JobLevel + MaritalStatusMarried + PercentSalaryHike + TotalWorkingYears + 
##     YearsAtCompany + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - PercentSalaryHike            1     950091 1280391210 10064
## - Age                          1    1369465 1280810584 10064
## - EnvironmentSatisfaction      1    2200960 1281642079 10064
## - YearsAtCompany               1    2851821 1282292940 10065
## <none>                                      1279441119 10065
## - EducationFieldMarketing      1    5043710 1284484828 10066
## - MaritalStatusMarried         1    5952989 1285394108 10067
## - JobInvolvement               1    6586772 1286027891 10067
## - YearsWithCurrManager         1    8754537 1288195656 10068
## - DistanceFromHome             1   12876391 1292317510 10070
## - BusinessTravelTravel_Rarely  1   13366760 1292807879 10071
## - TotalWorkingYears            1   50247598 1329688717 10090
## - JobLevel                     1 4513670441 5793111560 11114
## 
## Step:  AIC=10063.86
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     EducationFieldMarketing + EnvironmentSatisfaction + JobInvolvement + 
##     JobLevel + MaritalStatusMarried + TotalWorkingYears + YearsAtCompany + 
##     YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - Age                          1    1392641 1281783851 10063
## - EnvironmentSatisfaction      1    2202308 1282593518 10063
## - YearsAtCompany               1    2812469 1283203679 10063
## <none>                                      1280391210 10064
## - EducationFieldMarketing      1    4784488 1285175698 10064
## - MaritalStatusMarried         1    6093985 1286485195 10065
## - JobInvolvement               1    6459064 1286850274 10065
## - YearsWithCurrManager         1    8719056 1289110266 10067
## - DistanceFromHome             1   13103092 1293494302 10069
## - BusinessTravelTravel_Rarely  1   13340076 1293731286 10069
## - TotalWorkingYears            1   50751909 1331143120 10089
## - JobLevel                     1 4512730249 5793121459 11112
## 
## Step:  AIC=10062.61
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsAtCompany + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - EnvironmentSatisfaction      1    2194472 1283978323 10062
## - YearsAtCompany               1    2393731 1284177582 10062
## <none>                                      1281783851 10063
## - EducationFieldMarketing      1    5096388 1286880239 10063
## - MaritalStatusMarried         1    5790294 1287574145 10064
## - JobInvolvement               1    6323161 1288107012 10064
## - YearsWithCurrManager         1    8366747 1290150598 10065
## - DistanceFromHome             1   12987999 1294771850 10068
## - BusinessTravelTravel_Rarely  1   13684413 1295468264 10068
## - TotalWorkingYears            1   58985754 1340769605 10092
## - JobLevel                     1 4533538882 5815322733 11113
## 
## Step:  AIC=10061.8
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + TotalWorkingYears + 
##     YearsAtCompany + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - YearsAtCompany               1    2353768 1286332091 10061
## <none>                                      1283978323 10062
## - EducationFieldMarketing      1    5014651 1288992974 10062
## - MaritalStatusMarried         1    6076639 1290054962 10063
## - JobInvolvement               1    6167706 1290146030 10063
## - YearsWithCurrManager         1    8359532 1292337856 10064
## - DistanceFromHome             1   12796795 1296775118 10067
## - BusinessTravelTravel_Rarely  1   13677649 1297655973 10067
## - TotalWorkingYears            1   59256924 1343235248 10091
## - JobLevel                     1 4531932128 5815910451 11111
## 
## Step:  AIC=10061.08
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + TotalWorkingYears + 
##     YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## <none>                                      1286332091 10061
## - EducationFieldMarketing      1    4991128 1291323220 10062
## - MaritalStatusMarried         1    5969761 1292301852 10062
## - JobInvolvement               1    6656244 1292988336 10063
## - DistanceFromHome             1   13041201 1299373292 10066
## - BusinessTravelTravel_Rarely  1   14102045 1300434136 10067
## - YearsWithCurrManager         1   30753815 1317085906 10076
## - TotalWorkingYears            1   58007301 1344339392 10090
## - JobLevel                     1 4529783307 5816115399 11109
## Start:  AIC=10055.77
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - MaritalStatusSingle               1       6265 1232217384 10054
## - YearsAtCompany                    1      52828 1232263948 10054
## - YearsSinceLastPromotion           1     125045 1232336165 10054
## - Age                               1     137060 1232348180 10054
## - TrainingTimesLastYear             1     209944 1232421064 10054
## - BusinessTravelTravel_Rarely       1     406414 1232617534 10054
## - RelationshipSatisfaction          1     437290 1232648410 10054
## - JobSatisfaction                   1     548211 1232759331 10054
## - YearsInCurrentRole                1    1062088 1233273208 10054
## - EducationFieldMedical             1    1074721 1233285841 10054
## - NumCompaniesWorked                1    1373917 1233585037 10054
## - Education                         1    1481722 1233692842 10055
## - `EducationFieldTechnical Degree`  1    1519321 1233730441 10055
## - BusinessTravelTravel_Frequently   1    1637300 1233848420 10055
## - `EducationFieldLife Sciences`     1    2045900 1234257019 10055
## - PercentSalaryHike                 1    2273369 1234484489 10055
## - JobInvolvement                    1    2661448 1234872568 10055
## - OverTimeYes                       1    2719995 1234931115 10055
## - MaritalStatusMarried              1    2951295 1235162415 10055
## - GenderMale                        1    3197513 1235408632 10056
## <none>                                           1232211120 10056
## - YearsWithCurrManager              1    3603698 1235814818 10056
## - EducationFieldOther               1    4110118 1236321237 10056
## - EnvironmentSatisfaction           1    8208078 1240419198 10058
## - EducationFieldMarketing           1    9469610 1241680729 10059
## - DistanceFromHome                  1   13287852 1245498972 10061
## - TotalWorkingYears                 1   42396343 1274607462 10077
## - JobLevel                          1 4389855475 5622066594 11109
## 
## Step:  AIC=10053.78
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsAtCompany                    1      52670 1232270055 10052
## - YearsSinceLastPromotion           1     124245 1232341630 10052
## - Age                               1     133127 1232350512 10052
## - TrainingTimesLastYear             1     208622 1232426006 10052
## - BusinessTravelTravel_Rarely       1     401847 1232619231 10052
## - RelationshipSatisfaction          1     433311 1232650696 10052
## - JobSatisfaction                   1     551009 1232768394 10052
## - YearsInCurrentRole                1    1058191 1233275576 10052
## - EducationFieldMedical             1    1081136 1233298520 10052
## - NumCompaniesWorked                1    1376486 1233593871 10053
## - Education                         1    1478492 1233695877 10053
## - `EducationFieldTechnical Degree`  1    1531309 1233748694 10053
## - BusinessTravelTravel_Frequently   1    1669168 1233886552 10053
## - `EducationFieldLife Sciences`     1    2060736 1234278121 10053
## - PercentSalaryHike                 1    2272127 1234489511 10053
## - JobInvolvement                    1    2701517 1234918901 10053
## - OverTimeYes                       1    2733732 1234951116 10053
## - GenderMale                        1    3257310 1235474695 10054
## <none>                                           1232217384 10054
## - YearsWithCurrManager              1    3617499 1235834884 10054
## - EducationFieldOther               1    4135831 1236353215 10054
## - MaritalStatusMarried              1    4992511 1237209895 10055
## - EnvironmentSatisfaction           1    8210812 1240428196 10056
## - EducationFieldMarketing           1    9528160 1241745545 10057
## - DistanceFromHome                  1   13281593 1245498977 10059
## - TotalWorkingYears                 1   42392201 1274609586 10075
## - JobLevel                          1 4395247733 5627465117 11107
## 
## Step:  AIC=10051.81
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Age                               1     121456 1232391511 10050
## - TrainingTimesLastYear             1     190728 1232460783 10050
## - YearsSinceLastPromotion           1     197956 1232468011 10050
## - BusinessTravelTravel_Rarely       1     395309 1232665364 10050
## - RelationshipSatisfaction          1     419893 1232689948 10050
## - JobSatisfaction                   1     589592 1232859647 10050
## - EducationFieldMedical             1    1063967 1233334022 10050
## - NumCompaniesWorked                1    1325144 1233595199 10051
## - YearsInCurrentRole                1    1417946 1233688001 10051
## - Education                         1    1456027 1233726082 10051
## - `EducationFieldTechnical Degree`  1    1505628 1233775683 10051
## - BusinessTravelTravel_Frequently   1    1669773 1233939828 10051
## - `EducationFieldLife Sciences`     1    2037400 1234307455 10051
## - PercentSalaryHike                 1    2283193 1234553248 10051
## - OverTimeYes                       1    2695877 1234965932 10051
## - JobInvolvement                    1    2754400 1235024455 10051
## - GenderMale                        1    3242410 1235512465 10052
## <none>                                           1232270055 10052
## - EducationFieldOther               1    4103159 1236373214 10052
## - YearsWithCurrManager              1    4903925 1237173980 10053
## - MaritalStatusMarried              1    4991627 1237261682 10053
## - EnvironmentSatisfaction           1    8218961 1240489016 10054
## - EducationFieldMarketing           1    9479428 1241749483 10055
## - DistanceFromHome                  1   13245308 1245515362 10057
## - TotalWorkingYears                 1   45719674 1277989729 10075
## - JobLevel                          1 4402385424 5634655479 11106
## 
## Step:  AIC=10049.88
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsSinceLastPromotion           1     186220 1232577731 10048
## - TrainingTimesLastYear             1     191515 1232583026 10048
## - RelationshipSatisfaction          1     431156 1232822667 10048
## - BusinessTravelTravel_Rarely       1     432934 1232824445 10048
## - JobSatisfaction                   1     595334 1232986845 10048
## - EducationFieldMedical             1    1081078 1233472589 10048
## - Education                         1    1360643 1233752154 10049
## - YearsInCurrentRole                1    1375286 1233766798 10049
## - NumCompaniesWorked                1    1419878 1233811389 10049
## - `EducationFieldTechnical Degree`  1    1530700 1233922211 10049
## - BusinessTravelTravel_Frequently   1    1610405 1234001917 10049
## - `EducationFieldLife Sciences`     1    2079053 1234470564 10049
## - PercentSalaryHike                 1    2292040 1234683551 10049
## - OverTimeYes                       1    2666535 1235058046 10049
## - JobInvolvement                    1    2724768 1235116279 10049
## - GenderMale                        1    3252663 1235644175 10050
## <none>                                           1232391511 10050
## - EducationFieldOther               1    4097569 1236489081 10050
## - YearsWithCurrManager              1    4823322 1237214833 10051
## - MaritalStatusMarried              1    4918807 1237310318 10051
## - EnvironmentSatisfaction           1    8293563 1240685075 10052
## - EducationFieldMarketing           1    9594182 1241985693 10053
## - DistanceFromHome                  1   13171167 1245562678 10055
## - TotalWorkingYears                 1   57680164 1290071675 10080
## - JobLevel                          1 4424248161 5656639672 11107
## 
## Step:  AIC=10047.98
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsInCurrentRole + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - TrainingTimesLastYear             1     209616 1232787347 10046
## - RelationshipSatisfaction          1     401563 1232979294 10046
## - BusinessTravelTravel_Rarely       1     452516 1233030247 10046
## - JobSatisfaction                   1     577347 1233155078 10046
## - EducationFieldMedical             1    1132787 1233710518 10047
## - NumCompaniesWorked                1    1320620 1233898351 10047
## - Education                         1    1350943 1233928674 10047
## - `EducationFieldTechnical Degree`  1    1609430 1234187161 10047
## - BusinessTravelTravel_Frequently   1    1632586 1234210317 10047
## - YearsInCurrentRole                1    1711894 1234289625 10047
## - `EducationFieldLife Sciences`     1    2135951 1234713682 10047
## - PercentSalaryHike                 1    2360834 1234938565 10047
## - OverTimeYes                       1    2670402 1235248133 10048
## - JobInvolvement                    1    2797181 1235374912 10048
## - GenderMale                        1    3178954 1235756685 10048
## <none>                                           1232577731 10048
## - EducationFieldOther               1    4115982 1236693712 10048
## - MaritalStatusMarried              1    4924135 1237501866 10049
## - YearsWithCurrManager              1    5198472 1237776203 10049
## - EnvironmentSatisfaction           1    8235683 1240813414 10051
## - EducationFieldMarketing           1    9700077 1242277808 10051
## - DistanceFromHome                  1   13063826 1245641557 10053
## - TotalWorkingYears                 1   58769222 1291346953 10078
## - JobLevel                          1 4434927780 5667505511 11106
## 
## Step:  AIC=10046.1
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     YearsInCurrentRole + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - RelationshipSatisfaction          1     415260 1233202607 10044
## - BusinessTravelTravel_Rarely       1     487814 1233275161 10044
## - JobSatisfaction                   1     638070 1233425417 10044
## - EducationFieldMedical             1    1087832 1233875178 10045
## - Education                         1    1297903 1234085250 10045
## - NumCompaniesWorked                1    1427022 1234214369 10045
## - BusinessTravelTravel_Frequently   1    1563176 1234350523 10045
## - `EducationFieldTechnical Degree`  1    1579216 1234366563 10045
## - YearsInCurrentRole                1    1735262 1234522609 10045
## - `EducationFieldLife Sciences`     1    2120316 1234907663 10045
## - PercentSalaryHike                 1    2303788 1235091135 10045
## - OverTimeYes                       1    2580972 1235368319 10046
## - JobInvolvement                    1    2738054 1235525400 10046
## - GenderMale                        1    3228265 1236015612 10046
## <none>                                           1232787347 10046
## - EducationFieldOther               1    4103578 1236890925 10046
## - MaritalStatusMarried              1    4838715 1237626062 10047
## - YearsWithCurrManager              1    5162403 1237949750 10047
## - EnvironmentSatisfaction           1    8362451 1241149798 10049
## - EducationFieldMarketing           1    9707142 1242494489 10050
## - DistanceFromHome                  1   13216523 1246003869 10052
## - TotalWorkingYears                 1   58670268 1291457615 10076
## - JobLevel                          1 4436069520 5668856867 11104
## 
## Step:  AIC=10044.33
## .outcome ~ BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - BusinessTravelTravel_Rarely       1     479301 1233681907 10043
## - JobSatisfaction                   1     696243 1233898849 10043
## - EducationFieldMedical             1    1111305 1234313911 10043
## - Education                         1    1243229 1234445836 10043
## - NumCompaniesWorked                1    1338889 1234541496 10043
## - BusinessTravelTravel_Frequently   1    1510808 1234713415 10043
## - YearsInCurrentRole                1    1629854 1234832460 10043
## - `EducationFieldTechnical Degree`  1    1656482 1234859089 10043
## - `EducationFieldLife Sciences`     1    2204203 1235406809 10044
## - PercentSalaryHike                 1    2262979 1235465586 10044
## - OverTimeYes                       1    2641849 1235844456 10044
## - JobInvolvement                    1    2779905 1235982511 10044
## - GenderMale                        1    3298852 1236501458 10044
## <none>                                           1233202607 10044
## - EducationFieldOther               1    4211281 1237413887 10045
## - MaritalStatusMarried              1    4651803 1237854409 10045
## - YearsWithCurrManager              1    5299687 1238502293 10045
## - EnvironmentSatisfaction           1    8299039 1241501646 10047
## - EducationFieldMarketing           1    9851902 1243054508 10048
## - DistanceFromHome                  1   13071435 1246274041 10050
## - TotalWorkingYears                 1   58349626 1291552233 10074
## - JobLevel                          1 4439618152 5672820759 11103
## 
## Step:  AIC=10042.6
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     JobSatisfaction + MaritalStatusMarried + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - JobSatisfaction                   1     703810 1234385718 10041
## - EducationFieldMedical             1    1083398 1234765306 10041
## - Education                         1    1238590 1234920497 10041
## - NumCompaniesWorked                1    1376552 1235058460 10041
## - `EducationFieldTechnical Degree`  1    1595582 1235277489 10042
## - YearsInCurrentRole                1    1604420 1235286327 10042
## - `EducationFieldLife Sciences`     1    2157982 1235839890 10042
## - PercentSalaryHike                 1    2227256 1235909163 10042
## - OverTimeYes                       1    2816830 1236498738 10042
## - JobInvolvement                    1    2923382 1236605290 10042
## - GenderMale                        1    3158239 1236840146 10042
## <none>                                           1233681907 10043
## - EducationFieldOther               1    4162518 1237844425 10043
## - MaritalStatusMarried              1    4816323 1238498230 10043
## - YearsWithCurrManager              1    5464595 1239146503 10044
## - BusinessTravelTravel_Frequently   1    7250475 1240932383 10045
## - EnvironmentSatisfaction           1    8295096 1241977003 10045
## - EducationFieldMarketing           1    9727272 1243409179 10046
## - DistanceFromHome                  1   13534323 1247216230 10048
## - TotalWorkingYears                 1   58777081 1292458988 10073
## - JobLevel                          1 4439502295 5673184202 11101
## 
## Step:  AIC=10041
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - EducationFieldMedical             1    1156871 1235542589 10040
## - Education                         1    1161113 1235546831 10040
## - NumCompaniesWorked                1    1288558 1235674275 10040
## - `EducationFieldTechnical Degree`  1    1646057 1236031774 10040
## - YearsInCurrentRole                1    1700473 1236086191 10040
## - PercentSalaryHike                 1    2128747 1236514465 10040
## - `EducationFieldLife Sciences`     1    2293975 1236679693 10040
## - OverTimeYes                       1    2745099 1237130817 10040
## - GenderMale                        1    3055008 1237440726 10041
## - JobInvolvement                    1    3105800 1237491518 10041
## <none>                                           1234385718 10041
## - EducationFieldOther               1    4266046 1238651764 10041
## - MaritalStatusMarried              1    4715854 1239101572 10042
## - YearsWithCurrManager              1    5340711 1239726429 10042
## - BusinessTravelTravel_Frequently   1    7692091 1242077809 10043
## - EnvironmentSatisfaction           1    8117082 1242502800 10044
## - EducationFieldMarketing           1    9860289 1244246007 10044
## - DistanceFromHome                  1   13225200 1247610918 10046
## - TotalWorkingYears                 1   58761253 1293146971 10071
## - JobLevel                          1 4454715744 5689101462 11101
## 
## Step:  AIC=10039.65
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldTechnical Degree`  1     500304 1236042893 10038
## - Education                         1    1257458 1236800047 10038
## - NumCompaniesWorked                1    1358828 1236901417 10038
## - YearsInCurrentRole                1    1685212 1237227801 10039
## - PercentSalaryHike                 1    1996769 1237539358 10039
## - `EducationFieldLife Sciences`     1    2385740 1237928329 10039
## - OverTimeYes                       1    2695142 1238237731 10039
## - JobInvolvement                    1    3156677 1238699266 10039
## - GenderMale                        1    3190265 1238732854 10039
## <none>                                           1235542589 10040
## - EducationFieldOther               1    4591516 1240134105 10040
## - MaritalStatusMarried              1    5184987 1240727576 10041
## - YearsWithCurrManager              1    5622576 1241165165 10041
## - BusinessTravelTravel_Frequently   1    7758100 1243300689 10042
## - EnvironmentSatisfaction           1    7988257 1243530846 10042
## - DistanceFromHome                  1   13308615 1248851204 10045
## - EducationFieldMarketing           1   22131311 1257673900 10050
## - TotalWorkingYears                 1   58828726 1294371315 10070
## - JobLevel                          1 4459036597 5694579186 11100
## 
## Step:  AIC=10037.93
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - Education                        1    1254795 1237297688 10037
## - NumCompaniesWorked               1    1397480 1237440373 10037
## - YearsInCurrentRole               1    1776492 1237819385 10037
## - `EducationFieldLife Sciences`    1    1920292 1237963185 10037
## - PercentSalaryHike                1    2172865 1238215758 10037
## - OverTimeYes                      1    2730741 1238773634 10038
## - JobInvolvement                   1    3172778 1239215671 10038
## - GenderMale                       1    3244609 1239287502 10038
## <none>                                          1236042893 10038
## - EducationFieldOther              1    4190437 1240233330 10038
## - MaritalStatusMarried             1    5139229 1241182122 10039
## - YearsWithCurrManager             1    5522530 1241565423 10039
## - BusinessTravelTravel_Frequently  1    7799323 1243842216 10040
## - EnvironmentSatisfaction          1    8146012 1244188905 10040
## - DistanceFromHome                 1   13136585 1249179478 10043
## - EducationFieldMarketing          1   21774407 1257817300 10048
## - TotalWorkingYears                1   59872196 1295915089 10069
## - JobLevel                         1 4459310390 5695353283 11098
## 
## Step:  AIC=10036.64
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - NumCompaniesWorked               1    1093713 1238391402 10035
## - YearsInCurrentRole               1    1822044 1239119733 10036
## - `EducationFieldLife Sciences`    1    1858292 1239155980 10036
## - PercentSalaryHike                1    2190793 1239488482 10036
## - OverTimeYes                      1    2604842 1239902531 10036
## - JobInvolvement                   1    3231470 1240529158 10036
## - GenderMale                       1    3238318 1240536007 10036
## <none>                                          1237297688 10037
## - EducationFieldOther              1    4243693 1241541381 10037
## - MaritalStatusMarried             1    5049558 1242347246 10038
## - YearsWithCurrManager             1    5296702 1242594391 10038
## - BusinessTravelTravel_Frequently  1    7851782 1245149471 10039
## - EnvironmentSatisfaction          1    8285131 1245582819 10039
## - DistanceFromHome                 1   12651133 1249948822 10042
## - EducationFieldMarketing          1   20784487 1258082175 10046
## - TotalWorkingYears                1   60297194 1297594883 10068
## - JobLevel                         1 4470349826 5707647515 11097
## 
## Step:  AIC=10035.25
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + OverTimeYes + 
##     PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - YearsInCurrentRole               1    1432339 1239823740 10034
## - `EducationFieldLife Sciences`    1    1968576 1240359978 10034
## - PercentSalaryHike                1    2239969 1240631371 10034
## - OverTimeYes                      1    2652593 1241043995 10035
## - JobInvolvement                   1    3213826 1241605227 10035
## - GenderMale                       1    3296705 1241688107 10035
## <none>                                          1238391402 10035
## - EducationFieldOther              1    4212136 1242603538 10036
## - YearsWithCurrManager             1    4753788 1243145190 10036
## - MaritalStatusMarried             1    5036349 1243427751 10036
## - BusinessTravelTravel_Frequently  1    7870676 1246262078 10038
## - EnvironmentSatisfaction          1    8317493 1246708894 10038
## - DistanceFromHome                 1   12309663 1250701065 10040
## - EducationFieldMarketing          1   20689540 1259080942 10045
## - TotalWorkingYears                1   61206583 1299597985 10067
## - JobLevel                         1 4492142666 5730534068 11098
## 
## Step:  AIC=10034.05
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + OverTimeYes + 
##     PercentSalaryHike + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - `EducationFieldLife Sciences`    1    1977099 1241800839 10033
## - PercentSalaryHike                1    2158180 1241981920 10033
## - OverTimeYes                      1    2679237 1242502977 10034
## - JobInvolvement                   1    3121524 1242945265 10034
## - GenderMale                       1    3459650 1243283390 10034
## <none>                                          1239823740 10034
## - EducationFieldOther              1    4281661 1244105401 10034
## - MaritalStatusMarried             1    4505703 1244329443 10035
## - BusinessTravelTravel_Frequently  1    7779374 1247603115 10036
## - EnvironmentSatisfaction          1    8539341 1248363081 10037
## - DistanceFromHome                 1   12012283 1251836024 10039
## - YearsWithCurrManager             1   16021308 1255845048 10041
## - EducationFieldMarketing          1   21069901 1260893642 10044
## - TotalWorkingYears                1   59778386 1299602126 10065
## - JobLevel                         1 4493921861 5733745601 11096
## 
## Step:  AIC=10033.16
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldOther + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     OverTimeYes + PercentSalaryHike + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - PercentSalaryHike                1    2174540 1243975379 10032
## - OverTimeYes                      1    2560374 1244361213 10033
## - JobInvolvement                   1    3166763 1244967602 10033
## - EducationFieldOther              1    3171237 1244972076 10033
## - GenderMale                       1    3514507 1245315346 10033
## <none>                                          1241800839 10033
## - MaritalStatusMarried             1    4601847 1246402686 10034
## - BusinessTravelTravel_Frequently  1    7721785 1249522624 10036
## - EnvironmentSatisfaction          1    8301445 1250102284 10036
## - DistanceFromHome                 1   11806313 1253607152 10038
## - YearsWithCurrManager             1   16210695 1258011534 10040
## - EducationFieldMarketing          1   19092946 1260893785 10042
## - TotalWorkingYears                1   60268984 1302069823 10064
## - JobLevel                         1 4491948845 5733749684 11094
## 
## Step:  AIC=10032.38
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldOther + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     OverTimeYes + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - OverTimeYes                      1    2469300 1246444679 10032
## - EducationFieldOther              1    3131593 1247106972 10032
## - JobInvolvement                   1    3201981 1247177359 10032
## - GenderMale                       1    3463442 1247438821 10032
## <none>                                          1243975379 10032
## - MaritalStatusMarried             1    4426662 1248402041 10033
## - BusinessTravelTravel_Frequently  1    7834708 1251810087 10035
## - EnvironmentSatisfaction          1    8374333 1252349711 10035
## - DistanceFromHome                 1   10993146 1254968525 10036
## - YearsWithCurrManager             1   16185703 1260161081 10039
## - EducationFieldMarketing          1   19921292 1263896670 10041
## - TotalWorkingYears                1   59565054 1303540433 10063
## - JobLevel                         1 4495898313 5739873691 11093
## 
## Step:  AIC=10031.76
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldOther + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - JobInvolvement                   1    2987427 1249432106 10031
## - EducationFieldOther              1    3078830 1249523509 10032
## - GenderMale                       1    3399945 1249844624 10032
## <none>                                          1246444679 10032
## - MaritalStatusMarried             1    4090219 1250534898 10032
## - BusinessTravelTravel_Frequently  1    7563961 1254008640 10034
## - EnvironmentSatisfaction          1    7887177 1254331856 10034
## - DistanceFromHome                 1   10470253 1256914932 10036
## - YearsWithCurrManager             1   16580851 1263025530 10039
## - EducationFieldMarketing          1   19976502 1266421181 10041
## - TotalWorkingYears                1   59114287 1305558966 10062
## - JobLevel                         1 4497098217 5743542896 11092
## 
## Step:  AIC=10031.42
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldOther + EnvironmentSatisfaction + 
##     GenderMale + JobLevel + MaritalStatusMarried + TotalWorkingYears + 
##     YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - GenderMale                       1    3264283 1252696389 10031
## - EducationFieldOther              1    3374097 1252806203 10031
## <none>                                          1249432106 10031
## - MaritalStatusMarried             1    4079261 1253511368 10032
## - BusinessTravelTravel_Frequently  1    7486104 1256918210 10034
## - EnvironmentSatisfaction          1    8201611 1257633717 10034
## - DistanceFromHome                 1   10791164 1260223270 10035
## - YearsWithCurrManager             1   16256938 1265689045 10038
## - EducationFieldMarketing          1   19730202 1269162308 10040
## - TotalWorkingYears                1   59912478 1309344584 10062
## - JobLevel                         1 4494519223 5743951329 11090
## 
## Step:  AIC=10031.23
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     EducationFieldMarketing + EducationFieldOther + EnvironmentSatisfaction + 
##     JobLevel + MaritalStatusMarried + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## - EducationFieldOther              1    3299873 1255996262 10031
## <none>                                          1252696389 10031
## - MaritalStatusMarried             1    3772331 1256468720 10031
## - EnvironmentSatisfaction          1    8067315 1260763704 10034
## - BusinessTravelTravel_Frequently  1    8155754 1260852143 10034
## - DistanceFromHome                 1   10673198 1263369587 10035
## - YearsWithCurrManager             1   17309683 1270006072 10039
## - EducationFieldMarketing          1   19983926 1272680315 10040
## - TotalWorkingYears                1   59742250 1312438639 10062
## - JobLevel                         1 4491933720 5744630109 11088
## 
## Step:  AIC=10031.06
## .outcome ~ BusinessTravelTravel_Frequently + DistanceFromHome + 
##     EducationFieldMarketing + EnvironmentSatisfaction + JobLevel + 
##     MaritalStatusMarried + TotalWorkingYears + YearsWithCurrManager
## 
##                                   Df  Sum of Sq        RSS   AIC
## <none>                                          1255996262 10031
## - MaritalStatusMarried             1    3828213 1259824475 10031
## - BusinessTravelTravel_Frequently  1    7868288 1263864550 10033
## - EnvironmentSatisfaction          1    8703988 1264700250 10034
## - DistanceFromHome                 1   10933344 1266929606 10035
## - YearsWithCurrManager             1   17297049 1273293312 10039
## - EducationFieldMarketing          1   18685525 1274681787 10039
## - TotalWorkingYears                1   61643582 1317639844 10062
## - JobLevel                         1 4489270477 5745266739 11086
## Start:  AIC=12592.92
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + JobSatisfaction + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - JobSatisfaction                   1       3803 1576942349 12591
## - BusinessTravelTravel_Frequently   1       5558 1576944104 12591
## - MaritalStatusSingle               1       7382 1576945928 12591
## - OverTimeYes                       1     134759 1577073304 12591
## - Education                         1     188564 1577127110 12591
## - Age                               1     198788 1577137334 12591
## - YearsSinceLastPromotion           1     238457 1577177002 12591
## - NumCompaniesWorked                1     586477 1577525022 12591
## - RelationshipSatisfaction          1     611674 1577550219 12591
## - TrainingTimesLastYear             1     622516 1577561061 12591
## - YearsInCurrentRole                1     628641 1577567187 12591
## - YearsAtCompany                    1     635530 1577574076 12591
## - PercentSalaryHike                 1     971456 1577910001 12592
## - EducationFieldMedical             1     981944 1577920489 12592
## - `EducationFieldTechnical Degree`  1    1176428 1578114973 12592
## - GenderMale                        1    1217116 1578155661 12592
## - `EducationFieldLife Sciences`     1    1309979 1578248524 12592
## - EducationFieldOther               1    1670418 1578608964 12592
## - MaritalStatusMarried              1    3096525 1580035070 12593
## - JobInvolvement                    1    3492756 1580431302 12593
## <none>                                           1576938546 12593
## - EnvironmentSatisfaction           1    4514628 1581453174 12593
## - EducationFieldMarketing           1    5727264 1582665810 12594
## - BusinessTravelTravel_Rarely       1    8134971 1585073517 12595
## - YearsWithCurrManager              1    8251530 1585190076 12596
## - DistanceFromHome                  1   13760347 1590698892 12598
## - TotalWorkingYears                 1   48866471 1625805017 12618
## - JobLevel                          1 5411804264 6988742810 13886
## 
## Step:  AIC=12590.93
## .outcome ~ Age + BusinessTravelTravel_Frequently + BusinessTravelTravel_Rarely + 
##     DistanceFromHome + Education + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     MaritalStatusSingle + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - BusinessTravelTravel_Frequently   1       5097 1576947446 12589
## - MaritalStatusSingle               1       7003 1576949351 12589
## - OverTimeYes                       1     133810 1577076159 12589
## - Education                         1     187070 1577129419 12589
## - Age                               1     200671 1577143020 12589
## - YearsSinceLastPromotion           1     242475 1577184824 12589
## - NumCompaniesWorked                1     583290 1577525638 12589
## - RelationshipSatisfaction          1     616026 1577558375 12589
## - YearsInCurrentRole                1     626907 1577569256 12589
## - TrainingTimesLastYear             1     628466 1577570815 12589
## - YearsAtCompany                    1     647896 1577590245 12589
## - PercentSalaryHike                 1     970905 1577913254 12590
## - EducationFieldMedical             1     987026 1577929375 12590
## - `EducationFieldTechnical Degree`  1    1179398 1578121746 12590
## - GenderMale                        1    1214316 1578156664 12590
## - `EducationFieldLife Sciences`     1    1316429 1578258777 12590
## - EducationFieldOther               1    1677012 1578619361 12590
## - MaritalStatusMarried              1    3093547 1580035895 12591
## - JobInvolvement                    1    3512742 1580455091 12591
## <none>                                           1576942349 12591
## - EnvironmentSatisfaction           1    4511496 1581453845 12591
## - EducationFieldMarketing           1    5738899 1582681248 12592
## - BusinessTravelTravel_Rarely       1    8138966 1585081315 12593
## - YearsWithCurrManager              1    8247727 1585190076 12594
## - DistanceFromHome                  1   13758001 1590700350 12596
## - TotalWorkingYears                 1   48970630 1625912979 12616
## - JobLevel                          1 5415487839 6992430188 13885
## 
## Step:  AIC=12588.93
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + MaritalStatusSingle + NumCompaniesWorked + 
##     OverTimeYes + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - MaritalStatusSingle               1       8197 1576955643 12587
## - OverTimeYes                       1     137569 1577085015 12587
## - Education                         1     187032 1577134478 12587
## - Age                               1     203057 1577150503 12587
## - YearsSinceLastPromotion           1     243467 1577190913 12587
## - NumCompaniesWorked                1     588896 1577536342 12587
## - RelationshipSatisfaction          1     621222 1577568668 12587
## - YearsInCurrentRole                1     626030 1577573476 12587
## - TrainingTimesLastYear             1     636931 1577584377 12587
## - YearsAtCompany                    1     648881 1577596327 12587
## - PercentSalaryHike                 1     968767 1577916213 12588
## - EducationFieldMedical             1     988082 1577935528 12588
## - `EducationFieldTechnical Degree`  1    1179130 1578126576 12588
## - GenderMale                        1    1210003 1578157449 12588
## - `EducationFieldLife Sciences`     1    1315852 1578263298 12588
## - EducationFieldOther               1    1676541 1578623987 12588
## - MaritalStatusMarried              1    3120088 1580067534 12589
## - JobInvolvement                    1    3540430 1580487876 12589
## <none>                                           1576947446 12589
## - EnvironmentSatisfaction           1    4508568 1581456014 12589
## - EducationFieldMarketing           1    5736427 1582683873 12590
## - YearsWithCurrManager              1    8259850 1585207296 12592
## - DistanceFromHome                  1   13783647 1590731093 12594
## - BusinessTravelTravel_Rarely       1   17267430 1594214876 12596
## - TotalWorkingYears                 1   49239553 1626186999 12614
## - JobLevel                          1 5420921283 6997868729 13883
## 
## Step:  AIC=12586.93
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + OverTimeYes + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsAtCompany + YearsInCurrentRole + 
##     YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - OverTimeYes                       1     137588 1577093230 12585
## - Education                         1     187579 1577143222 12585
## - Age                               1     209766 1577165408 12585
## - YearsSinceLastPromotion           1     243670 1577199312 12585
## - NumCompaniesWorked                1     587504 1577543146 12585
## - RelationshipSatisfaction          1     625888 1577581531 12585
## - YearsInCurrentRole                1     634567 1577590210 12585
## - TrainingTimesLastYear             1     636346 1577591989 12585
## - YearsAtCompany                    1     649143 1577604786 12585
## - PercentSalaryHike                 1     969628 1577925271 12586
## - EducationFieldMedical             1     984159 1577939802 12586
## - `EducationFieldTechnical Degree`  1    1174301 1578129944 12586
## - GenderMale                        1    1201821 1578157464 12586
## - `EducationFieldLife Sciences`     1    1310353 1578265996 12586
## - EducationFieldOther               1    1670245 1578625888 12586
## - JobInvolvement                    1    3533829 1580489472 12587
## <none>                                           1576955643 12587
## - EnvironmentSatisfaction           1    4525763 1581481406 12587
## - MaritalStatusMarried              1    4743891 1581699534 12588
## - EducationFieldMarketing           1    5728426 1582684069 12588
## - YearsWithCurrManager              1    8252055 1585207697 12590
## - DistanceFromHome                  1   13806507 1590762150 12592
## - BusinessTravelTravel_Rarely       1   17268018 1594223661 12594
## - TotalWorkingYears                 1   49257002 1626212644 12612
## - JobLevel                          1 5423097578 7000053221 13882
## 
## Step:  AIC=12585.01
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     Education + `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Education                         1     179557 1577272787 12583
## - Age                               1     198431 1577291661 12583
## - YearsSinceLastPromotion           1     243551 1577336781 12583
## - NumCompaniesWorked                1     582650 1577675881 12583
## - TrainingTimesLastYear             1     603666 1577696896 12583
## - YearsAtCompany                    1     628685 1577721915 12583
## - RelationshipSatisfaction          1     633524 1577726754 12583
## - YearsInCurrentRole                1     640880 1577734110 12583
## - PercentSalaryHike                 1     961752 1578054983 12584
## - EducationFieldMedical             1     963788 1578057019 12584
## - `EducationFieldTechnical Degree`  1    1165680 1578258910 12584
## - GenderMale                        1    1198404 1578291634 12584
## - `EducationFieldLife Sciences`     1    1290177 1578383407 12584
## - EducationFieldOther               1    1638322 1578731552 12584
## - JobInvolvement                    1    3491288 1580584518 12585
## <none>                                           1577093230 12585
## - EnvironmentSatisfaction           1    4446120 1581539350 12586
## - MaritalStatusMarried              1    4677319 1581770550 12586
## - EducationFieldMarketing           1    5691581 1582784811 12586
## - YearsWithCurrManager              1    8345949 1585439179 12588
## - DistanceFromHome                  1   13683981 1590777211 12590
## - BusinessTravelTravel_Rarely       1   17339153 1594432383 12592
## - TotalWorkingYears                 1   49143022 1626236252 12610
## - JobLevel                          1 5422961522 7000054753 13880
## 
## Step:  AIC=12583.11
## .outcome ~ Age + BusinessTravelTravel_Rarely + DistanceFromHome + 
##     `EducationFieldLife Sciences` + EducationFieldMarketing + 
##     EducationFieldMedical + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + NumCompaniesWorked + PercentSalaryHike + 
##     RelationshipSatisfaction + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsAtCompany + YearsInCurrentRole + YearsSinceLastPromotion + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - Age                               1     149156 1577421942 12581
## - YearsSinceLastPromotion           1     258401 1577531188 12581
## - NumCompaniesWorked                1     512533 1577785320 12581
## - TrainingTimesLastYear             1     579968 1577852755 12581
## - RelationshipSatisfaction          1     612625 1577885412 12581
## - YearsAtCompany                    1     641394 1577914181 12582
## - YearsInCurrentRole                1     643978 1577916765 12582
## - PercentSalaryHike                 1     969471 1578242257 12582
## - EducationFieldMedical             1     983377 1578256164 12582
## - `EducationFieldTechnical Degree`  1    1178304 1578451091 12582
## - GenderMale                        1    1205814 1578478601 12582
## - `EducationFieldLife Sciences`     1    1306831 1578579617 12582
## - EducationFieldOther               1    1640783 1578913570 12582
## - JobInvolvement                    1    3544479 1580817266 12583
## <none>                                           1577272787 12583
## - EnvironmentSatisfaction           1    4524631 1581797418 12584
## - MaritalStatusMarried              1    4660294 1581933080 12584
## - EducationFieldMarketing           1    5659796 1582932583 12584
## - YearsWithCurrManager              1    8213150 1585485937 12586
## - DistanceFromHome                  1   13551880 1590824667 12589
## - BusinessTravelTravel_Rarely       1   17437045 1594709832 12591
## - TotalWorkingYears                 1   48967521 1626240308 12608
## - JobLevel                          1 5433299752 7010572539 13879
## 
## Step:  AIC=12581.19
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     NumCompaniesWorked + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsSinceLastPromotion + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsSinceLastPromotion           1     258247 1577680189 12579
## - NumCompaniesWorked                1     565817 1577987760 12580
## - TrainingTimesLastYear             1     580592 1578002535 12580
## - YearsAtCompany                    1     600259 1578022201 12580
## - RelationshipSatisfaction          1     605079 1578027022 12580
## - YearsInCurrentRole                1     629565 1578051507 12580
## - PercentSalaryHike                 1     957519 1578379461 12580
## - EducationFieldMedical             1     988557 1578410499 12580
## - `EducationFieldTechnical Degree`  1    1189480 1578611422 12580
## - GenderMale                        1    1209105 1578631048 12580
## - `EducationFieldLife Sciences`     1    1329008 1578750950 12580
## - EducationFieldOther               1    1628494 1579050436 12580
## - JobInvolvement                    1    3506467 1580928409 12581
## <none>                                           1577421942 12581
## - EnvironmentSatisfaction           1    4546261 1581968204 12582
## - MaritalStatusMarried              1    4588576 1582010518 12582
## - EducationFieldMarketing           1    5730158 1583152100 12582
## - YearsWithCurrManager              1    8152362 1585574304 12584
## - DistanceFromHome                  1   13552922 1590974865 12587
## - BusinessTravelTravel_Rarely       1   17531150 1594953093 12589
## - TotalWorkingYears                 1   60565705 1637987648 12612
## - JobLevel                          1 5452943899 7030365841 13879
## 
## Step:  AIC=12579.33
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     NumCompaniesWorked + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsAtCompany + 
##     YearsInCurrentRole + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - YearsAtCompany                    1     428038 1578108228 12578
## - TrainingTimesLastYear             1     529758 1578209947 12578
## - YearsInCurrentRole                1     554080 1578234269 12578
## - NumCompaniesWorked                1     583258 1578263447 12578
## - RelationshipSatisfaction          1     635739 1578315929 12578
## - PercentSalaryHike                 1     913528 1578593717 12578
## - EducationFieldMedical             1     930962 1578611152 12578
## - `EducationFieldTechnical Degree`  1    1119006 1578799195 12578
## - GenderMale                        1    1237841 1578918031 12578
## - `EducationFieldLife Sciences`     1    1268727 1578948916 12578
## - EducationFieldOther               1    1583597 1579263786 12578
## - JobInvolvement                    1    3476308 1581156498 12579
## <none>                                           1577680189 12579
## - EnvironmentSatisfaction           1    4501024 1582181213 12580
## - MaritalStatusMarried              1    4643267 1582323456 12580
## - EducationFieldMarketing           1    5615309 1583295499 12580
## - YearsWithCurrManager              1    8149914 1585830103 12582
## - DistanceFromHome                  1   13605882 1591286071 12585
## - BusinessTravelTravel_Rarely       1   17312870 1594993060 12587
## - TotalWorkingYears                 1   61805417 1639485606 12611
## - JobLevel                          1 5471723022 7049403212 13880
## 
## Step:  AIC=12577.57
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     NumCompaniesWorked + PercentSalaryHike + RelationshipSatisfaction + 
##     TotalWorkingYears + TrainingTimesLastYear + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - NumCompaniesWorked                1     362509 1578470737 12576
## - TrainingTimesLastYear             1     484361 1578592589 12576
## - RelationshipSatisfaction          1     586442 1578694670 12576
## - EducationFieldMedical             1     917607 1579025835 12576
## - PercentSalaryHike                 1     950169 1579058397 12576
## - `EducationFieldTechnical Degree`  1    1073341 1579181569 12576
## - GenderMale                        1    1217853 1579326080 12576
## - `EducationFieldLife Sciences`     1    1231328 1579339556 12576
## - YearsInCurrentRole                1    1365197 1579473424 12576
## - EducationFieldOther               1    1517542 1579625770 12576
## <none>                                           1578108228 12578
## - JobInvolvement                    1    3756267 1581864495 12578
## - EnvironmentSatisfaction           1    4469907 1582578135 12578
## - MaritalStatusMarried              1    4641594 1582749822 12578
## - EducationFieldMarketing           1    5530210 1583638438 12579
## - YearsWithCurrManager              1   12131699 1590239926 12582
## - DistanceFromHome                  1   13408764 1591516992 12583
## - BusinessTravelTravel_Rarely       1   17433569 1595541797 12585
## - TotalWorkingYears                 1   66684365 1644792593 12612
## - JobLevel                          1 5475251523 7053359751 13878
## 
## Step:  AIC=12575.77
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + RelationshipSatisfaction + TotalWorkingYears + 
##     TrainingTimesLastYear + YearsInCurrentRole + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - RelationshipSatisfaction          1     537019 1579007755 12574
## - TrainingTimesLastYear             1     541708 1579012445 12574
## - PercentSalaryHike                 1     953756 1579424493 12574
## - EducationFieldMedical             1     955969 1579426705 12574
## - `EducationFieldTechnical Degree`  1    1127643 1579598379 12574
## - YearsInCurrentRole                1    1207781 1579678518 12574
## - GenderMale                        1    1241144 1579711881 12574
## - `EducationFieldLife Sciences`     1    1283584 1579754321 12574
## - EducationFieldOther               1    1549769 1580020506 12575
## <none>                                           1578470737 12576
## - JobInvolvement                    1    3753160 1582223896 12576
## - EnvironmentSatisfaction           1    4532105 1583002842 12576
## - MaritalStatusMarried              1    4611853 1583082590 12576
## - EducationFieldMarketing           1    5604690 1584075427 12577
## - YearsWithCurrManager              1   11775932 1590246669 12580
## - DistanceFromHome                  1   13188326 1591659063 12581
## - BusinessTravelTravel_Rarely       1   17568226 1596038963 12583
## - TotalWorkingYears                 1   71303025 1649773762 12612
## - JobLevel                          1 5536202742 7114673478 13884
## 
## Step:  AIC=12574.07
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + TotalWorkingYears + TrainingTimesLastYear + 
##     YearsInCurrentRole + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - TrainingTimesLastYear             1     549366 1579557121 12572
## - PercentSalaryHike                 1     882972 1579890727 12573
## - EducationFieldMedical             1     991741 1579999496 12573
## - YearsInCurrentRole                1    1161726 1580169481 12573
## - `EducationFieldTechnical Degree`  1    1195856 1580203611 12573
## - GenderMale                        1    1257430 1580265186 12573
## - `EducationFieldLife Sciences`     1    1365695 1580373451 12573
## - EducationFieldOther               1    1632925 1580640680 12573
## <none>                                           1579007755 12574
## - JobInvolvement                    1    3813201 1582820957 12574
## - MaritalStatusMarried              1    4410557 1583418312 12574
## - EnvironmentSatisfaction           1    4522968 1583530724 12575
## - EducationFieldMarketing           1    5730670 1584738426 12575
## - YearsWithCurrManager              1   11924264 1590932019 12579
## - DistanceFromHome                  1   12999645 1592007400 12579
## - BusinessTravelTravel_Rarely       1   17272555 1596280311 12582
## - TotalWorkingYears                 1   71048878 1650056633 12610
## - JobLevel                          1 5539413461 7118421217 13882
## 
## Step:  AIC=12572.37
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     PercentSalaryHike + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - PercentSalaryHike                 1     882152 1580439273 12571
## - EducationFieldMedical             1     934045 1580491166 12571
## - `EducationFieldTechnical Degree`  1    1158127 1580715248 12571
## - YearsInCurrentRole                1    1177912 1580735033 12571
## - GenderMale                        1    1255700 1580812821 12571
## - `EducationFieldLife Sciences`     1    1354636 1580911757 12571
## - EducationFieldOther               1    1600986 1581158107 12571
## <none>                                           1579557121 12572
## - JobInvolvement                    1    3751432 1583308553 12572
## - MaritalStatusMarried              1    4307977 1583865098 12573
## - EnvironmentSatisfaction           1    4573711 1584130832 12573
## - EducationFieldMarketing           1    5693853 1585250974 12574
## - YearsWithCurrManager              1   11804023 1591361144 12577
## - DistanceFromHome                  1   13231823 1592788944 12578
## - BusinessTravelTravel_Rarely       1   17223332 1596780453 12580
## - TotalWorkingYears                 1   70803058 1650360179 12608
## - JobLevel                          1 5538869866 7118426987 13880
## 
## Step:  AIC=12570.85
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldMedical + EducationFieldOther + 
##     `EducationFieldTechnical Degree` + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsInCurrentRole + YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - EducationFieldMedical             1     900312 1581339585 12569
## - YearsInCurrentRole                1    1115860 1581555133 12570
## - `EducationFieldTechnical Degree`  1    1198622 1581637895 12570
## - GenderMale                        1    1245700 1581684973 12570
## - `EducationFieldLife Sciences`     1    1319594 1581758867 12570
## - EducationFieldOther               1    1544021 1581983293 12570
## <none>                                           1580439273 12571
## - JobInvolvement                    1    3800221 1584239494 12571
## - MaritalStatusMarried              1    4238887 1584678160 12571
## - EnvironmentSatisfaction           1    4567417 1585006690 12571
## - EducationFieldMarketing           1    5710644 1586149917 12572
## - YearsWithCurrManager              1   12026283 1592465556 12575
## - DistanceFromHome                  1   12897279 1593336552 12576
## - BusinessTravelTravel_Rarely       1   17228862 1597668134 12578
## - TotalWorkingYears                 1   70420406 1650859678 12607
## - JobLevel                          1 5538045947 7118485220 13878
## 
## Step:  AIC=12569.35
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldOther + `EducationFieldTechnical Degree` + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                                    Df  Sum of Sq        RSS   AIC
## - `EducationFieldTechnical Degree`  1     300928 1581640513 12568
## - `EducationFieldLife Sciences`     1     656765 1581996350 12568
## - EducationFieldOther               1     694093 1582033677 12568
## - YearsInCurrentRole                1    1150398 1582489983 12568
## - GenderMale                        1    1329476 1582669060 12568
## <none>                                           1581339585 12569
## - JobInvolvement                    1    3802576 1585142161 12569
## - EnvironmentSatisfaction           1    4494727 1585834311 12570
## - MaritalStatusMarried              1    4567351 1585906936 12570
## - YearsWithCurrManager              1   12147640 1593487225 12574
## - DistanceFromHome                  1   13038265 1594377849 12574
## - EducationFieldMarketing           1   13136738 1594476322 12574
## - BusinessTravelTravel_Rarely       1   17128297 1598467881 12577
## - TotalWorkingYears                 1   70342855 1651682439 12605
## - JobLevel                          1 5544158375 7125497959 13877
## 
## Step:  AIC=12567.51
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + `EducationFieldLife Sciences` + 
##     EducationFieldMarketing + EducationFieldOther + EnvironmentSatisfaction + 
##     GenderMale + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsInCurrentRole + YearsWithCurrManager
## 
##                                 Df  Sum of Sq        RSS   AIC
## - `EducationFieldLife Sciences`  1     438722 1582079234 12566
## - EducationFieldOther            1     554854 1582195367 12566
## - YearsInCurrentRole             1    1198420 1582838933 12566
## - GenderMale                     1    1348099 1582988611 12566
## <none>                                        1581640513 12568
## - JobInvolvement                 1    3812536 1585453049 12568
## - MaritalStatusMarried           1    4488235 1586128748 12568
## - EnvironmentSatisfaction        1    4587122 1586227635 12568
## - YearsWithCurrManager           1   12075731 1593716244 12572
## - DistanceFromHome               1   12896797 1594537309 12573
## - EducationFieldMarketing        1   12922393 1594562906 12573
## - BusinessTravelTravel_Rarely    1   17082647 1598723160 12575
## - TotalWorkingYears              1   71046809 1652687322 12604
## - JobLevel                       1 5543880292 7125520804 13875
## 
## Step:  AIC=12565.76
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EducationFieldOther + EnvironmentSatisfaction + GenderMale + 
##     JobInvolvement + JobLevel + MaritalStatusMarried + TotalWorkingYears + 
##     YearsInCurrentRole + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - EducationFieldOther          1     357353 1582436587 12564
## - YearsInCurrentRole           1    1190021 1583269255 12564
## - GenderMale                   1    1338565 1583417800 12564
## <none>                                      1582079234 12566
## - JobInvolvement               1    3772165 1585851399 12566
## - MaritalStatusMarried         1    4511766 1586591000 12566
## - EnvironmentSatisfaction      1    4556300 1586635534 12566
## - YearsWithCurrManager         1   12097238 1594176473 12570
## - DistanceFromHome             1   12755714 1594834948 12571
## - EducationFieldMarketing      1   12790926 1594870161 12571
## - BusinessTravelTravel_Rarely  1   16922277 1599001512 12573
## - TotalWorkingYears            1   71541114 1653620349 12602
## - JobLevel                     1 5548027776 7130107011 13874
## 
## Step:  AIC=12563.95
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + TotalWorkingYears + YearsInCurrentRole + 
##     YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - YearsInCurrentRole           1    1185652 1583622239 12563
## - GenderMale                   1    1306186 1583742774 12563
## <none>                                      1582436587 12564
## - JobInvolvement               1    3878198 1586314785 12564
## - MaritalStatusMarried         1    4525054 1586961641 12564
## - EnvironmentSatisfaction      1    4749834 1587186421 12565
## - YearsWithCurrManager         1   12083079 1594519666 12569
## - EducationFieldMarketing      1   12500834 1594937422 12569
## - DistanceFromHome             1   12819835 1595256423 12569
## - BusinessTravelTravel_Rarely  1   16845050 1599281637 12571
## - TotalWorkingYears            1   72132444 1654569032 12601
## - JobLevel                     1 5551384114 7133820701 13872
## 
## Step:  AIC=12562.6
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + GenderMale + JobInvolvement + JobLevel + 
##     MaritalStatusMarried + TotalWorkingYears + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## - GenderMale                   1    1393607 1585015846 12561
## <none>                                      1583622239 12563
## - JobInvolvement               1    3824983 1587447223 12563
## - MaritalStatusMarried         1    4172584 1587794824 12563
## - EnvironmentSatisfaction      1    5073964 1588696204 12563
## - EducationFieldMarketing      1   12554652 1596176892 12568
## - DistanceFromHome             1   12794396 1596416635 12568
## - BusinessTravelTravel_Rarely  1   16592918 1600215158 12570
## - YearsWithCurrManager         1   28480066 1612102306 12576
## - TotalWorkingYears            1   71021240 1654643480 12599
## - JobLevel                     1 5550206003 7133828242 13870
## 
## Step:  AIC=12561.37
## .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + EducationFieldMarketing + 
##     EnvironmentSatisfaction + JobInvolvement + JobLevel + MaritalStatusMarried + 
##     TotalWorkingYears + YearsWithCurrManager
## 
##                               Df  Sum of Sq        RSS   AIC
## <none>                                      1585015846 12561
## - JobInvolvement               1    3932348 1588948194 12562
## - MaritalStatusMarried         1    3970026 1588985873 12562
## - EnvironmentSatisfaction      1    4979154 1589995000 12562
## - DistanceFromHome             1   12838996 1597854842 12566
## - EducationFieldMarketing      1   12878775 1597894622 12566
## - BusinessTravelTravel_Rarely  1   16737293 1601753139 12568
## - YearsWithCurrManager         1   29408237 1614424083 12575
## - TotalWorkingYears            1   70832125 1655847971 12597
## - JobLevel                     1 5548821138 7133836984 13868
# Final model
summary(case2.salary.stepwise)
## 
## Call:
## lm(formula = .outcome ~ BusinessTravelTravel_Rarely + DistanceFromHome + 
##     EducationFieldMarketing + EnvironmentSatisfaction + JobInvolvement + 
##     JobLevel + MaritalStatusMarried + TotalWorkingYears + YearsWithCurrManager, 
##     data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5857.8  -761.3     0.4   735.0  4244.8 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 -1887.027    253.357  -7.448 2.30e-13 ***
## BusinessTravelTravel_Rarely   308.194    102.270   3.014  0.00266 ** 
## DistanceFromHome              -15.086      5.716  -2.639  0.00846 ** 
## EducationFieldMarketing      -385.885    145.978  -2.643  0.00836 ** 
## EnvironmentSatisfaction       -68.977     41.965  -1.644  0.10061    
## JobInvolvement                 95.713     65.526   1.461  0.14447    
## JobLevel                     3745.203     68.256  54.870  < 2e-16 ***
## MaritalStatusMarried          137.169     93.461   1.468  0.14256    
## TotalWorkingYears              64.114     10.342   6.199 8.79e-10 ***
## YearsWithCurrManager          -58.150     14.557  -3.995 7.04e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1358 on 860 degrees of freedom
## Multiple R-squared:  0.9137, Adjusted R-squared:  0.9128 
## F-statistic:  1012 on 9 and 860 DF,  p-value: < 2.2e-16
# Results including RMSE of final model
case2.salary.stepwise$results
##   parameter     RMSE  Rsquared      MAE   RMSESD  RsquaredSD    MAESD
## 1      none 1380.859 0.9105557 1044.099 56.46585 0.008736908 48.60545

Buliding a Random Forest model and Comparing to Linear Regression Model

We will the variables that were selected by random forest feature selection to build the model.

We found that, the Random Forest performs slightly better with an Adjusted R-squared of 0.9472 and the RMSE of $1069.555 as compared to Linear regression model.

train(MonthlyIncome ~ JobLevel + JobRole + TotalWorkingYears + YearsAtCompany + Age,
  data = case2_salary,
  method = "lm",
  trControl = train.CV
) -> case2_salary.stepwise.rf

# Final model
summary(case2_salary.stepwise.rf)
## 
## Call:
## lm(formula = .outcome ~ ., data = dat)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3947.4  -637.6   -21.3   604.0  4122.0 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      -67.470    263.485  -0.256  0.79796    
## JobLevel                        2800.149     82.407  33.979  < 2e-16 ***
## `JobRoleHuman Resources`        -317.625    252.023  -1.260  0.20790    
## `JobRoleLaboratory Technician`  -595.611    169.362  -3.517  0.00046 ***
## JobRoleManager                  3991.649    229.479  17.394  < 2e-16 ***
## `JobRoleManufacturing Director`  136.295    167.359   0.814  0.41565    
## `JobRoleResearch Director`      3973.272    216.235  18.375  < 2e-16 ***
## `JobRoleResearch Scientist`     -322.429    169.632  -1.901  0.05767 .  
## `JobRoleSales Executive`         -65.567    144.365  -0.454  0.64982    
## `JobRoleSales Representative`   -413.192    212.294  -1.946  0.05194 .  
## TotalWorkingYears                 51.888     10.345   5.016 6.42e-07 ***
## YearsAtCompany                    -6.050      8.052  -0.751  0.45267    
## Age                               -1.231      5.496  -0.224  0.82282    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1064 on 857 degrees of freedom
## Multiple R-squared:  0.9472, Adjusted R-squared:  0.9465 
## F-statistic:  1282 on 12 and 857 DF,  p-value: < 2.2e-16
# Results including RMSE of final model
case2_salary.stepwise.rf$results
##   intercept     RMSE  Rsquared      MAE   RMSESD  RsquaredSD    MAESD
## 1      TRUE 1072.637 0.9463836 823.1558 56.95502 0.003972972 49.31881

Generating the predictions for both Linear regression and Random Forest Model on the training data

** We found that the random forest model are making predictions with lower RMSE(prediction error)=0.1651 as compared to the linear regression model with RMSE(prediction error)=0.2112.

# generating predictions on test data
case2$MonthlyIncome_LM <- predict(case2.salary.stepwise, newdata = case2)
case2$MonthlyIncome_LM
##   [1]  6203.103 17743.516  9682.083  9963.727  2256.400  9378.931  2747.356
##   [8]  6189.144  2297.004  5611.070 17848.577  1999.341 10372.419  2417.691
##  [15]  2396.606  5641.202  6422.155  6163.953  2648.697  6803.394  6546.452
##  [22]  6530.650  5712.927  6051.128  6102.043 18057.681  6151.839  5818.311
##  [29] 10358.284  1924.216  5457.387  2373.281 14785.895  2438.062  6264.573
##  [36]  2280.763 10520.312  6292.564 18938.773  1945.592 14770.909  6358.035
##  [43]  2909.863 18407.508  2305.650  2244.732  6564.361  9274.503  1546.047
##  [50]  2002.019  2744.403 19041.388  2821.333  5872.239  6111.148  2198.776
##  [57]  2079.964  2620.687 10397.065  1449.012 10351.955  9888.408  2567.572
##  [64]  1796.160  2122.426  2562.864  6403.552  2084.542  2333.715  2845.402
##  [71]  3069.051  6057.609  6210.000  2656.378  9964.621  6030.818  9986.617
##  [78] 14527.112 10183.003  2020.118  6871.240  6335.542  6006.571  6423.410
##  [85]  6417.860 15105.265  6200.944  2143.933  9409.102 18232.662  2040.520
##  [92]  9486.243  2500.514  6387.415 18175.235  7116.218 14990.566  6647.636
##  [99]  2116.562  2536.470  2438.864 10064.382  5642.911  2761.341 15257.535
## [106]  2678.019  5854.484 19079.422  6169.602  2287.587  1828.198 14737.053
## [113] 10854.408  6610.259  6427.150  9397.902  6103.343  6234.834  2541.611
## [120]  6219.555 10029.328  2183.078 10184.098  5557.767  5840.182  6141.140
## [127]  1808.650  5901.008  6760.583 14808.242  6076.382  5651.286  5449.860
## [134]  6327.741  6014.040  5992.160  2406.040 10562.999  2620.867 10286.643
## [141] 14795.811  2049.486  9988.837  6429.083  6622.808  5861.764  2267.581
## [148]  6542.829  2083.925  5846.697  6325.367  5562.001  6226.941  6669.994
## [155]  2228.811  5514.790  6162.079 14337.415 10254.539 10593.956  6590.313
## [162]  9157.783  5753.593  6286.897  9492.912  2132.623 15040.193 14051.157
## [169]  6462.990  2122.378  5432.668  6228.327 11111.253  9402.917 14746.219
## [176]  2078.732 18571.542  2451.719  9161.170  6381.253 10340.207  6328.790
## [183]  2718.418 10176.171  2060.729  2266.969  5721.901 15359.704 18751.286
## [190]  5917.360  5819.474  9673.151  6473.199  6272.415  2521.067  2432.777
## [197]  2645.687 14570.033 10360.977  2026.713 14387.125  6300.632  6405.289
## [204]  2412.109  2591.788  2771.713  5690.998  6850.372  2498.784  9963.529
## [211] 14004.084 18180.657  2378.912  6345.786  2505.981  2613.018  7132.140
## [218] 13904.809  2200.957  2582.846  6044.717  5887.047  5774.711  2337.848
## [225]  2646.471  2662.003  2250.350  2338.042  6361.803 14658.743  5914.710
## [232]  1910.643 14005.309  6363.903 13823.976 10584.194 18196.974  6225.066
## [239]  2621.960  9894.349  9619.056 18021.528  2505.661  2558.599  6506.366
## [246]  2521.679  9755.137  2417.968  5877.638 14603.466  1960.677  6063.171
## [253]  2253.785  2267.168  9704.035  2273.062  1420.022  5827.929 10390.835
## [260]  2479.928  2004.841  2571.936  2452.858  1849.879  2449.563  2586.275
## [267] 13519.154  2211.545  5620.836  6159.731  6024.675  6059.451  5867.066
## [274]  5994.931 18547.749 18776.955  2367.686  1957.502  5644.987  6139.787
## [281]  6205.742  2380.816  6571.612  5857.749  2913.172  6330.182  2136.116
## [288]  2104.967  9644.932  2477.057  2559.127  5767.726  2316.177  9750.669
## [295] 14331.013  2353.097  5743.685  5752.639  1847.055  2504.373  6280.993
## [302]  9475.217  2353.541  6100.925  2596.227  2209.535  2898.839  2319.266
## [309]  6232.097  6175.157  6701.716 14115.204  1865.899  6637.751  6027.314
## [316]  6032.437  1927.880  6090.115  6134.700  2040.087  2169.025  2613.579
## [323]  2302.907  6517.518 14320.772  2319.327 18083.884  6111.984  6273.437
## [330] 14291.539 14941.718  9985.802  2133.532 10029.044 18737.593  5720.732
## [337]  5267.051  5992.481  5920.094  2211.545  2666.265  1892.621  9957.590
## [344]  1957.241  5892.753 13703.882  5788.709  5820.585  1806.205 15348.846
## [351] 10530.638  6422.130  6358.631  5890.535 10474.623  5950.030  2343.640
## [358]  2237.422  6363.645  2610.429 18910.280  1736.152 18487.435 18222.326
## [365] 17908.953 15217.407  5777.165  6650.006  2399.782  6429.366  5887.677
## [372]  9410.010 10360.225  2407.728  2053.758 14178.969  2440.869  6391.435
## [379]  2245.244  2580.460 18508.393  2112.464  6345.702  2408.749  3208.357
## [386] 10112.150  9203.759  6032.785  6644.495  2041.581  6276.648  5620.947
## [393]  1975.133  9432.812  2373.800  2292.450 15335.946  2397.858  5978.633
## [400] 10377.116  6359.136  5955.736  2628.580 10328.426  2070.081 14711.324
## [407]  5774.246  2006.386 15211.903 14887.634  2515.535  9425.697  2679.004
## [414]  5334.322  1393.923  6277.050  2270.530  2156.177  6207.121 10036.249
## [421]  6397.939  6067.245  6278.303  1854.323  5728.976 10418.172  1896.898
## [428]  2228.973  2206.959  6244.221  5980.604  2081.694  6411.249  2085.660
## [435]  9947.732  5797.218  2478.827  2395.505  2070.888  6317.326  5818.528
## [442]  2639.724  2674.930  2628.104 18619.649  3480.250  6431.508  6738.663
## [449]  5294.911  5435.268  6554.628  2086.119  5818.553  5641.804 14669.670
## [456] 18071.956  6716.314  5994.345  2827.185  6149.618  2582.012  3066.188
## [463]  9829.545  5596.975  2108.064  2415.814  2548.904  2778.492  5456.145
## [470]  5968.522  2690.937  1475.748 10804.596  2211.664  2298.400  5792.621
## [477]  5776.857  6205.156  2799.828 10379.631  6520.202  2545.438  5779.327
## [484]  3227.754 11673.853  6267.834  2243.897  2138.420 11238.755  6406.760
## [491] 18062.540 14614.520  6025.521  9861.723  6185.445 13849.945  2767.454
## [498]  2148.914  6404.518  5975.319 11137.018  1999.039  2712.089  9760.811
## [505] 15045.197  6367.448  1780.402 10000.172  1998.390 18261.924  6233.836
## [512]  9731.543  2529.337  9815.567  2016.607  6418.386  1679.633  2350.723
## [519]  6314.766  2343.041  1811.531  2085.802 11303.204 18255.333  2691.574
## [526] 10279.804  6334.013  6289.540  2356.840  2515.870 10280.908  7007.379
## [533]  2366.576  5918.024  2182.360  2192.017  9893.089  2472.863  2521.530
## [540]  5900.805  6003.971  2838.492  1803.378  6927.395  2330.928  2304.470
## [547] 11343.670  6125.592 10699.259  2105.579 18013.789  2251.239  5802.619
## [554]  2846.533  5724.564  6733.851  7089.256  2552.160  5936.378  6219.727
## [561]  2541.330 14581.145  2282.531  9783.382  2440.756  2568.853  6141.345
## [568]  6321.218  6151.555 14308.073  6287.372  1970.171  5751.706  6348.894
## [575]  5610.699  6060.684  3556.008  2041.589  5937.137  6270.864  2360.637
## [582] 14298.986  6696.662  6004.032  6311.691  6396.978  6037.208  2481.781
## [589]  2615.199  2176.930  1738.591  6116.284  2402.691  2415.141 10146.357
## [596]  6322.188  9892.940  7354.318  6443.531  2822.322  1874.576  6197.419
## [603] 10088.133  2538.150  1614.399 15486.659  6818.567  6225.709  2342.553
## [610]  1867.003  6590.313  5929.745  2917.961  1829.200  9850.387  6232.545
## [617]  2762.256  6062.362  9788.925  1998.698  1747.294  6413.154  2862.872
## [624]  9514.728  2325.410  2470.309  6145.751  9661.001 10825.128  9606.498
## [631]  3312.402 10313.409  7233.662  2788.071 10409.691  1862.449 14587.776
## [638]  9990.766  2353.547  2034.791  1879.656  6434.386 14919.334  1894.346
## [645]  2225.765  9654.271  1817.698  1942.928  6055.719  2745.620  2142.845
## [652]  5911.003  9888.322 10536.324  1922.484  5938.886 10345.502 14046.185
## [659]  6133.188  5701.140  5830.739  2542.262 10365.843  2240.739  5253.793
## [666]  6220.076 10266.952  2380.708  6537.362 15289.869 10678.857  6044.717
## [673]  5724.106  1668.201  2632.021 17955.400  6464.254  5994.374  6592.015
## [680]  2968.590  5733.129  2086.385  6399.510 10007.403  2271.215  9969.493
## [687]  9387.564  2618.339  2253.785  2414.447  6194.737  9384.213  6901.443
## [694]  2070.383  5687.309  2127.760 14513.422  6466.148  1962.104 18497.689
## [701]  2192.658  6272.389  9291.697  2165.138  2694.707  5908.075  6444.918
## [708]  2549.240  2216.513 14862.252  9798.497 14752.692  2691.940  9890.965
## [715]  9468.133  1855.571  5905.033  6075.013  5860.011  9856.840 10004.836
## [722]  6303.044  2321.011  9887.773  2569.826  6456.088  2399.889  2039.119
## [729]  1757.206  2487.769  6265.504  6784.082  1850.020  5949.932  2343.046
## [736]  6365.252 13842.164  6393.541  6177.975  6117.600  6017.171 10118.658
## [743]  6304.878  2262.278  6161.132  1962.291  2349.158  5878.056  2146.449
## [750]  2356.563  1359.678  1930.364 14374.115 10213.840 10833.306  1867.276
## [757]  5977.261  7357.451  2703.225 17785.170  2123.372 15256.142  6036.116
## [764]  6198.909  2478.647  6133.465  2618.777 10039.085  6429.400  5922.157
## [771]  5638.981 10536.671 10215.695  2211.514 10482.193  2341.316  2441.727
## [778]  1972.327  1805.555  2646.772  1768.109  6497.697  2406.692  6095.575
## [785]  5661.155 14076.478 10812.257  6210.754 19418.542  2232.595  6512.819
## [792]  2231.009 10204.131 10241.033  5384.814  2265.170 14082.531  2327.176
## [799]  1893.880  6574.141  6368.073  6380.976 14233.389  9777.640  6516.393
## [806] 10208.977  6359.456  2109.046  2387.291  2453.822  5735.682  2839.113
## [813]  5532.181 18634.422  1911.396  2766.138  6635.262 10259.097  2458.054
## [820]  5609.187  2741.392  5760.041  5261.834  1861.195  6338.568 18501.644
## [827] 10025.986  5715.881  2235.944 18793.652  5516.631  1459.829  2142.661
## [834]  2174.921 15068.483  9600.947  2661.866  5935.805 10794.615 18384.962
## [841]  2201.322  9571.578 14825.829  9824.474  5954.504  5911.262  2334.412
## [848] 10628.725  5828.374  2186.614  5844.940  2122.056  5776.744  6085.074
## [855]  5863.044  2273.285  2412.656  9482.435  2464.173 10136.208  1926.995
## [862]  9612.136  5589.162 14098.997 10030.479  9847.718  5182.795  6506.701
## [869]  2748.598  6247.231
case2$MonthlyIncome_RF <- predict(case2_salary.stepwise.rf, newdata = case2)
case2$MonthlyIncome_RF
##   [1]  5812.726 18825.963  8932.968  8869.756  2655.737  8848.581  2698.798
##   [8]  5830.769  2323.473  5857.682 18864.846  2518.102  9259.886  2328.397
##  [15]  2834.962  5841.646  5996.439  5969.664  2649.477  5985.445  6281.202
##  [22]  6018.730  5354.768  5917.733  5773.286 19086.757  5884.917  5707.719
##  [29]  8968.388  2581.481  5846.465  2738.183 16478.665  2564.467  6038.786
##  [36]  2326.869  8924.000  6241.054 19681.608  2424.892 16876.438  5482.837
##  [43]  2946.746 19112.484  2427.777  2635.427  5946.750  8639.228  2297.330
##  [50]  2676.243  2778.577 19441.118  2814.471  5294.369  6135.185  2315.790
##  [57]  2709.666  2559.754 13008.774  2334.552  8956.509  8765.195  2424.892
##  [64]  2388.093  2153.364  2697.777  5946.567  2337.948  2608.457  3143.956
##  [71]  2952.188  5713.874  6035.093  2391.877  8673.882  5450.348  8683.941
##  [78] 16311.835  9290.496  2144.747  6259.551  6465.786  6092.829  5797.049
##  [85]  6461.997 12723.183  6404.816  2329.226  8646.719 18997.735  2136.130
##  [92]  8735.934  2454.738  5978.375 18922.774  6332.327 16182.928  6363.327
##  [99]  2290.773  2428.183  2384.912  8825.149  5718.587  2623.229 16802.787
## [106]  2471.770  6091.808 19612.802  6096.300  2554.213  2513.299 16355.404
## [113]  9154.552  6313.901  6160.149  8680.248  5671.729  5396.200  2979.877
## [120]  6132.712 12732.417  2385.314  9115.751  5793.241  5889.947  5882.561
## [127]  2829.243  6078.162  6074.234 12193.190  5889.947  5791.799  5808.045
## [134]  5954.083  5296.831  5850.296  2147.209  9483.838  2492.065  8814.272
## [141] 12797.845  2430.531  9038.794  5754.683  6189.313  5614.917  2736.335
## [148]  5829.644  2394.655  5915.736  5877.944  5886.254  6023.768  6034.977
## [155]  2141.054  5625.785  6129.796 12065.872  9301.926 13286.257  5358.672
## [162]  8756.894  5707.719  5659.429  8780.436  2386.545 16422.856 15548.358
## [169]  6019.875  2902.972  5900.815  5934.354  9717.114  8691.221 16098.225
## [176]  2476.077 19072.283  2671.424  8640.565  5994.743  9162.160  5948.904
## [183]  3273.152  8876.157  2455.767  2604.975  5959.217 16553.520 19237.364
## [190]  5661.986  5683.742  8678.093  6537.873  6080.159  2613.487  2393.310
## [197]  2568.970 12094.329  9391.033  2153.364 12153.805  5629.392  6271.469
## [204]  2852.315  2567.225  2722.794  5753.347  6362.096  2770.276  8785.149
## [211] 12187.606 18956.821  2566.207  6008.327  2612.256  2757.966  6413.984
## [218] 16177.908  2602.513  2744.952  5700.439  5665.258  5753.557  2421.622
## [225]  2852.105  2650.199  2139.823  2566.523  5627.121 12538.702  6072.113
## [232]  2368.080 12167.761  6194.698 16217.802  9019.265 18985.443  5446.039
## [239]  2683.509 13145.877  8875.955 19011.065  2655.632  2581.892  6091.808
## [246]  2492.275  8935.334  2423.661  5746.287 16106.947  2142.285  6003.254
## [253]  2400.695  2474.621 13032.771  2702.385  2373.004  5827.287  8662.301
## [260]  2457.411  2430.941  2890.873  2481.302  2421.304  2388.605  2375.064
## [267] 15810.058  2143.516  5904.751  5959.112  5882.350  5672.768  5498.945
## [274]  5975.565 19561.618 19278.604  2474.846  2502.731  5711.517  5654.528
## [281]  5872.713  3015.464  6075.996  6061.297  2689.146  5584.170  2429.008
## [288]  2238.780  8687.528  2413.918  2466.530  5409.223  2697.883 12896.180
## [295] 16038.142  2341.325  6085.653  5307.910  2561.493  2617.074  5886.254
## [302]  8636.872  2733.452  5625.699  2696.020  2388.605  2484.574  2679.725
## [309]  6298.822  5625.890  5623.439 12240.725  2692.959  6119.173  5900.183
## [316]  5821.951  2564.763  5686.639  5804.109  2432.701  2338.968  2826.781
## [323]  2861.953  6042.851 12184.018  2422.853 18912.716  5601.492  6080.389
## [330] 16041.729 16209.483  8869.756  2637.167  8848.581 19390.786  5817.564
## [337]  5653.369  5817.893  5665.153  2149.671  2671.214  2194.278  8741.198
## [344]  2419.160  5821.237 11988.206  5868.561  5912.148  2667.415 12560.333
## [351] 13109.886  5899.584  5985.318  5886.594  9277.271  6125.082  2607.437
## [358]  2673.781  6042.277  2832.216 19425.466  2329.628 19379.628 18871.801
## [365] 18935.701 12824.242  5607.138  5836.617  2577.391  5647.541  5814.317
## [372]  8694.914  8782.092  2731.411  2386.545 16511.676  2923.893  6141.991
## [379]  2655.632  2706.289 18920.189  2749.756  6174.394  2446.839  3220.957
## [386] 12947.047  8682.710  6030.380  5878.771  2431.152  5718.587  5682.597
## [393]  2555.444  9226.193  2761.554  2515.655 16380.710  2464.878  6059.792
## [400]  9233.217  6172.713  6157.942  2430.329  8737.505  2642.197 16137.063
## [407]  6031.049  2413.622 16516.819 16170.802  2651.819  8675.324  2773.758
## [414]  5635.422  2421.199  6362.011  2656.249  2294.256  6265.314 12728.935
## [421]  5856.462  5864.528  6009.409  2114.911  5661.986  9142.411  2419.160
## [428]  2521.915  2287.081  6235.268  5663.217  2648.141  5890.460  2420.391
## [435]  8782.889  5800.732  2623.124  2477.820  2395.454  5950.484  5641.491
## [442]  2538.114  2362.041  2763.896 19083.134  3198.191  6070.848  6000.007
## [449]  5348.824  5870.251  5956.639  2637.167  5882.561  5885.023 16137.186
## [456] 18838.291  5887.485  5914.753  2582.607  5351.286  2488.372  2846.874
## [463]  9023.969  6067.706  2662.597  2656.652  2620.239  2346.144  5786.373
## [470]  5839.123  2658.094  2420.391 13132.950  2785.550  2285.955  6082.621
## [477]  5882.657  5850.360  2665.465 12994.117  5778.210  2750.896  5908.009
## [484]  3315.087 10095.113  5795.597  2328.397  2601.282  8865.652  5979.606
## [491] 18969.615 16323.899  5816.419  8794.115  5881.330 16445.753  2757.861
## [498]  2548.058  6328.260  5919.984  9945.905  2389.731  3191.824  8891.958
## [505] 16276.636  5751.316  2324.704  8906.863  2894.038 18916.409  5878.868
## [512]  8923.215  2859.491 12953.202  2431.152  6256.688  2334.552  2418.335
## [519]  5364.721  2303.375  2649.477  2148.440  9246.303 19267.218  2694.789
## [526]  9668.062  5848.611  5769.698  2642.197  2674.284  9209.016  6195.215
## [533]  2832.936  5930.181  2422.239  2690.286  8733.463  2552.757  2571.024
## [540]  5846.254  5358.672  3035.563  2422.853  6342.727  2643.428  2826.781
## [547]  9024.509  5400.808 13184.847  2634.691 18882.898  2661.667  5629.272
## [554]  3025.707  5724.880  6285.661  5850.566  2643.428  6081.855  5801.963
## [561]  2718.900 16216.325  2299.285 12876.087  2451.256  2643.217  5328.520
## [568]  5888.716  5904.192 12276.812  6112.974  2430.239  5753.663  5883.792
## [575]  5716.336  5944.446  3304.418  2415.873  6085.548  5772.160  2451.361
## [582] 15878.855  6258.320  5799.501  5921.458  5623.950  5967.072  2763.803
## [589]  2488.477  2289.437  2566.523  6164.871  2526.311  2541.184  9245.123
## [596]  5839.184  9177.750  5919.687  5910.917  2679.936  2335.783  5601.702
## [603] 12687.915  2559.754  2375.466 16671.322  6408.194  5787.191  2477.820
## [610]  2422.430  5358.567  5952.841  2716.543  2341.937  8700.964  5582.939
## [617]  2481.302  5855.892  8709.614  2139.823  2158.288  6534.083  2863.078
## [624]  8384.814  2517.705  2606.206  5666.910 12815.582  9576.842  8709.719
## [631]  3298.169  8867.294  6400.305  2449.919  8792.875  2185.661 16133.406
## [638]  8644.152  2655.737  2521.492  2145.978  6219.561 16611.151  2597.589
## [645]  2613.171  8923.895  2114.911  2242.579  6163.640  2582.510  2231.500
## [652]  5949.512 13185.876 13043.859  2305.440  5730.015 13013.181 16322.694
## [659]  6003.509  5899.838  5356.210  3052.481  8824.833  2231.500  5889.841
## [666]  5997.860  8735.934  2487.351  5356.210 16847.394 13060.662  5701.669
## [673]  5668.036  2825.550  2618.305 19150.840  6089.241  5346.362  6534.592
## [680]  2913.523  5665.679  2481.091  5989.244  8855.219  2604.975  9027.010
## [687]  8715.874  2714.695  2159.519  2976.275  5651.008 12725.154  6201.508
## [694]  2522.936  5696.746  2399.147 16247.012  5644.464  2297.330 19122.922
## [701]  2425.195  5700.439  8975.888  2664.129  2693.543  6162.304  5828.011
## [708]  2773.849  2319.483 16484.215 12700.243 16708.973  2435.148  8974.657
## [715]  8681.479  2431.350  5888.716  5646.415  6032.175  8899.238  8882.110
## [722]  6066.370  2863.078  9118.582  2500.471  5873.590  2762.572  2597.589
## [729]  2150.902  2253.552  5817.694  6035.859  2427.657  5715.000  2414.236
## [736]  5852.620 11988.206  6032.879  5653.369  5342.976  5735.716 12775.098
## [743]  5623.237  2246.271  5717.567  2205.252  2574.809  6138.761  2382.555
## [750]  2559.032  2386.545  2418.842 12550.503  8888.820 13045.785  2519.649
## [757]  5948.128  6492.120  2453.507 19073.426  2530.216 16258.716  6287.719
## [764]  6282.690  2562.604  5340.207  2818.164  9249.880  6198.856  6099.442
## [771]  5851.284  9310.905  9207.785  2463.662  9405.594  2473.615  2659.205
## [778]  2325.935  2425.932  2570.005  2452.371  6401.586  2713.449  5885.023
## [785]  5610.908 15517.081 13028.067  5668.759 19596.983  2471.153  5377.630
## [792]  2817.240  8911.127  9067.914  5929.674  2828.012 12046.387  2155.826
## [799]  2432.701  6132.808  5915.271  5911.683 16039.373  8642.921  5747.000
## [806]  8994.386  5729.666  2474.846  2831.705  2658.094  5450.348  2451.361
## [813]  5666.910 19237.795  2416.275  3063.253  6254.849 12913.414  2381.219
## [820]  5732.023  2664.038  5932.294  5792.115  2190.585  5969.875 19031.246
## [827]  8742.080  5614.812  2520.985 19330.202  5294.369  2296.099  2377.631
## [834]  2432.701 12629.975  8634.410  2743.510  5883.792  9731.187 19219.119
## [841]  2114.911  8438.038 12759.489  8755.557  5724.637  5361.134  2159.519
## [848]  9161.947  5796.828  2477.820  5624.554  2558.523  5365.952  5916.956
## [855]  5815.442  2322.242  2758.177  8889.496  2419.566  8737.198  2447.045
## [862]  9280.859  5862.152 12329.474  8914.609  8920.457  5617.274  5949.925
## [869]  2699.923  5376.715
# Prediction Error for Linear Regression
case2.LM.RMSE=RMSE(case2$MonthlyIncome_LM, case2$MonthlyIncome) / mean(case2$MonthlyIncome)
case2.LM.RMSE
## [1] 0.2112216
# Prediction Error for Linear Regression
case2.RF.RMSE=RMSE(case2$MonthlyIncome_RF, case2$MonthlyIncome) / mean(case2$MonthlyIncome)
case2.RF.RMSE
## [1] 0.1651993

Generating the predictions for both Linear regression and Random Forest Model on the original test data for salary

We run the model on the test data sets that do not have the MonthlyIncome parameter

We have saved the predictions of the original test data in the Salary_LM.csv and Salary_RF.csv

NoSalary.df=read.csv("https://raw.githubusercontent.com/RashmiAPatel19/SMU_MSDS_6306_CaseStudy2_Spring2021/main/DDSCaseStudy2CompSet-NoSalary.csv",header=TRUE)
head(NoSalary.df)
##    ID Age Attrition    BusinessTravel DailyRate             Department
## 1 871  43        No Travel_Frequently      1422                  Sales
## 2 872  33        No     Travel_Rarely       461 Research & Development
## 3 873  55       Yes     Travel_Rarely       267                  Sales
## 4 874  36        No        Non-Travel      1351 Research & Development
## 5 875  27        No     Travel_Rarely      1302 Research & Development
## 6 876  39       Yes     Travel_Rarely       895                  Sales
##   DistanceFromHome Education   EducationField EmployeeCount EmployeeNumber
## 1                2         4    Life Sciences             1           1849
## 2               13         1    Life Sciences             1            995
## 3               13         4        Marketing             1           1372
## 4                9         4    Life Sciences             1           1949
## 5               19         3            Other             1           1619
## 6                5         3 Technical Degree             1             42
##   EnvironmentSatisfaction Gender HourlyRate JobInvolvement JobLevel
## 1                       1   Male         92              3        2
## 2                       2 Female         53              3        1
## 3                       1   Male         85              4        4
## 4                       1   Male         66              4        1
## 5                       4   Male         67              2        1
## 6                       4   Male         56              3        2
##                 JobRole JobSatisfaction MaritalStatus MonthlyRate
## 1       Sales Executive               4       Married       19246
## 2    Research Scientist               4        Single       17241
## 3       Sales Executive               3        Single        9277
## 4 Laboratory Technician               2       Married        9238
## 5 Laboratory Technician               1      Divorced       16290
## 6  Sales Representative               4       Married        3335
##   NumCompaniesWorked Over18 OverTime PercentSalaryHike PerformanceRating
## 1                  1      Y       No                20                 4
## 2                  3      Y       No                18                 3
## 3                  6      Y      Yes                17                 3
## 4                  1      Y       No                22                 4
## 5                  1      Y       No                11                 3
## 6                  3      Y       No                14                 3
##   RelationshipSatisfaction StandardHours StockOptionLevel TotalWorkingYears
## 1                        3            80                1                 7
## 2                        1            80                0                 5
## 3                        3            80                0                24
## 4                        2            80                0                 5
## 5                        1            80                2                 7
## 6                        3            80                1                19
##   TrainingTimesLastYear WorkLifeBalance YearsAtCompany YearsInCurrentRole
## 1                     5               3              7                  7
## 2                     4               3              3                  2
## 3                     2               2             19                  7
## 4                     3               3              5                  4
## 5                     3               3              7                  7
## 6                     6               4              1                  0
##   YearsSinceLastPromotion YearsWithCurrManager
## 1                       7                    7
## 2                       0                    2
## 3                       3                    8
## 4                       0                    2
## 5                       0                    7
## 6                       0                    0
dim(NoSalary.df)
## [1] 300  35
NoSalary.df$MonthlyIncome_LM <- predict(case2.salary.stepwise, newdata = NoSalary.df)
head(NoSalary.df$MonthlyIncome_LM)
## [1]  5970.287  2323.709 14207.384  2377.718  1837.006  7202.706
NoSalary.df$MonthlyIncome_RF <- predict(case2_salary.stepwise.rf, newdata = NoSalary.df)
head(NoSalary.df$MonthlyIncome_RF)
## [1]  5735.198  2610.919 12130.223  2321.945  2424.701  6051.449
output.LM=data.frame(Id=NoSalary.df$ID,NoSalary.df$MonthlyIncome_LM)
output.RF=data.frame(Id=NoSalary.df$ID,NoSalary.df$MonthlyIncome_RF)

head(output.LM)
##    Id NoSalary.df.MonthlyIncome_LM
## 1 871                     5970.287
## 2 872                     2323.709
## 3 873                    14207.384
## 4 874                     2377.718
## 5 875                     1837.006
## 6 876                     7202.706
head(output.RF)
##    Id NoSalary.df.MonthlyIncome_RF
## 1 871                     5735.198
## 2 872                     2610.919
## 3 873                    12130.223
## 4 874                     2321.945
## 5 875                     2424.701
## 6 876                     6051.449
write.csv(output.LM,file="Salary_LM.csv",row.names = FALSE)
write.csv(output.RF,file="Salary_RF.csv",row.names = FALSE)

Model for Attrition

Now we will focus on Attrition, first using K-Nearest Neighbor [KNN], and then comparing to a Random Forest model

First we need to split the data into a training & testing set. 80% of our data will be used for the training set and will be used to create the model. The remaining 20% is for the test set, which will be used to validate actual values vs predicted values using our model.

We need to measure the models:

dim(case2)
## [1] 870  33
case2_attrition.knn=case2[,-c(28,29,30,31,32,33)]
str(case2_attrition.knn)
## 'data.frame':    870 obs. of  27 variables:
##  $ Age                     : int  32 40 35 32 24 27 41 37 34 34 ...
##  $ Attrition               : chr  "No" "No" "No" "No" ...
##  $ BusinessTravel          : chr  "Travel_Rarely" "Travel_Rarely" "Travel_Frequently" "Travel_Rarely" ...
##  $ Department              : chr  "Sales" "Research & Development" "Research & Development" "Sales" ...
##  $ DistanceFromHome        : int  13 14 18 1 2 10 5 10 10 10 ...
##  $ Education               : int  4 3 2 4 1 2 5 4 4 4 ...
##  $ EducationField          : chr  "Life Sciences" "Medical" "Life Sciences" "Marketing" ...
##  $ EnvironmentSatisfaction : int  2 3 3 3 1 4 2 4 3 4 ...
##  $ Gender                  : chr  "Male" "Male" "Male" "Female" ...
##  $ JobInvolvement          : int  3 2 3 3 3 3 4 2 3 2 ...
##  $ JobLevel                : int  2 5 3 3 1 3 1 2 1 2 ...
##  $ JobRole                 : chr  "Sales Executive" "Research Director" "Manufacturing Director" "Sales Executive" ...
##  $ JobSatisfaction         : int  4 3 4 4 4 1 3 4 3 3 ...
##  $ MaritalStatus           : chr  "Divorced" "Single" "Single" "Married" ...
##  $ MonthlyIncome           : int  4403 19626 9362 10422 3760 8793 2127 6694 2220 5063 ...
##  $ NumCompaniesWorked      : int  2 1 2 1 1 1 2 2 1 1 ...
##  $ OverTime                : chr  "No" "No" "No" "No" ...
##  $ PercentSalaryHike       : int  11 14 11 19 13 21 12 14 19 14 ...
##  $ RelationshipSatisfaction: int  3 1 3 3 3 3 1 3 4 2 ...
##  $ StockOptionLevel        : int  1 0 0 2 0 2 0 3 1 1 ...
##  $ TotalWorkingYears       : int  8 21 10 14 6 9 7 8 1 8 ...
##  $ TrainingTimesLastYear   : int  3 2 2 3 2 4 5 5 2 3 ...
##  $ WorkLifeBalance         : int  2 4 3 3 3 2 2 3 3 2 ...
##  $ YearsAtCompany          : int  5 20 2 14 6 9 4 1 1 8 ...
##  $ YearsInCurrentRole      : int  2 7 2 10 3 7 2 0 1 2 ...
##  $ YearsSinceLastPromotion : int  0 4 2 5 1 1 0 0 0 7 ...
##  $ YearsWithCurrManager    : int  3 9 2 7 3 7 3 0 0 7 ...
attrition.partition <- createDataPartition(case2_attrition.knn$Attrition, p = 0.75, list = F)
attrition.train <- case2_attrition.knn[attrition.partition,] 
attrition.test <- case2_attrition.knn[-attrition.partition,]

# validate train and test sets
head(attrition.train)
##   Age Attrition    BusinessTravel             Department DistanceFromHome
## 1  32        No     Travel_Rarely                  Sales               13
## 2  40        No     Travel_Rarely Research & Development               14
## 3  35        No Travel_Frequently Research & Development               18
## 4  32        No     Travel_Rarely                  Sales                1
## 5  24        No Travel_Frequently Research & Development                2
## 6  27        No Travel_Frequently Research & Development               10
##   Education   EducationField EnvironmentSatisfaction Gender JobInvolvement
## 1         4    Life Sciences                       2   Male              3
## 2         3          Medical                       3   Male              2
## 3         2    Life Sciences                       3   Male              3
## 4         4        Marketing                       3 Female              3
## 5         1 Technical Degree                       1 Female              3
## 6         2    Life Sciences                       4   Male              3
##   JobLevel                JobRole JobSatisfaction MaritalStatus MonthlyIncome
## 1        2        Sales Executive               4      Divorced          4403
## 2        5      Research Director               3        Single         19626
## 3        3 Manufacturing Director               4        Single          9362
## 4        3        Sales Executive               4       Married         10422
## 5        1     Research Scientist               4        Single          3760
## 6        3 Manufacturing Director               1      Divorced          8793
##   NumCompaniesWorked OverTime PercentSalaryHike RelationshipSatisfaction
## 1                  2       No                11                        3
## 2                  1       No                14                        1
## 3                  2       No                11                        3
## 4                  1       No                19                        3
## 5                  1      Yes                13                        3
## 6                  1       No                21                        3
##   StockOptionLevel TotalWorkingYears TrainingTimesLastYear WorkLifeBalance
## 1                1                 8                     3               2
## 2                0                21                     2               4
## 3                0                10                     2               3
## 4                2                14                     3               3
## 5                0                 6                     2               3
## 6                2                 9                     4               2
##   YearsAtCompany YearsInCurrentRole YearsSinceLastPromotion
## 1              5                  2                       0
## 2             20                  7                       4
## 3              2                  2                       2
## 4             14                 10                       5
## 5              6                  3                       1
## 6              9                  7                       1
##   YearsWithCurrManager
## 1                    3
## 2                    9
## 3                    2
## 4                    7
## 5                    3
## 6                    7
head(attrition.test)
##    Age Attrition    BusinessTravel             Department DistanceFromHome
## 8   37        No     Travel_Rarely                  Sales               10
## 9   34        No     Travel_Rarely                  Sales               10
## 10  34        No Travel_Frequently Research & Development               10
## 16  31        No        Non-Travel                  Sales               20
## 21  36        No     Travel_Rarely Research & Development                9
## 25  33        No     Travel_Rarely Research & Development                1
##    Education   EducationField EnvironmentSatisfaction Gender JobInvolvement
## 8          4    Life Sciences                       4 Female              2
## 9          4    Life Sciences                       3 Female              3
## 10         4 Technical Degree                       4   Male              2
## 16         2        Marketing                       4 Female              3
## 21         2          Medical                       2   Male              2
## 25         3    Life Sciences                       2 Female              2
##    JobLevel                   JobRole JobSatisfaction MaritalStatus
## 8         2           Sales Executive               4      Divorced
## 9         1      Sales Representative               3       Married
## 10        2 Healthcare Representative               3       Married
## 16        2           Sales Executive               3       Married
## 21        2    Manufacturing Director               2      Divorced
## 25        2 Healthcare Representative               4        Single
##    MonthlyIncome NumCompaniesWorked OverTime PercentSalaryHike
## 8           6694                  2      Yes                14
## 9           2220                  1      Yes                19
## 10          5063                  1       No                14
## 16          6932                  1       No                13
## 21          8847                  2      Yes                11
## 25          6949                  0       No                14
##    RelationshipSatisfaction StockOptionLevel TotalWorkingYears
## 8                         3                3                 8
## 9                         4                1                 1
## 10                        2                1                 8
## 16                        4                1                 9
## 21                        3                1                13
## 25                        1                0                 6
##    TrainingTimesLastYear WorkLifeBalance YearsAtCompany YearsInCurrentRole
## 8                      5               3              1                  0
## 9                      2               3              1                  1
## 10                     3               2              8                  2
## 16                     2               2              9                  8
## 21                     2               3              3                  2
## 25                     3               3              5                  0
##    YearsSinceLastPromotion YearsWithCurrManager
## 8                        0                    0
## 9                        0                    0
## 10                       7                    7
## 16                       0                    0
## 21                       0                    2
## 25                       1                    4
dim(attrition.train)
## [1] 653  27
dim(attrition.test)
## [1] 217  27

K-Nearest Algorithm for Attrition

Overall when we run the model on the test data set we achieve above 80% for all categories.

   No Yes

No 180 2 Yes 27 8

Accuracy : 0.8664 Sensitivity : 0.8696
Specificity : 0.8000

set.seed(200)
train.knn<- trainControl(
  method = "repeatedcv",
  number = 5,
  repeats = 50,
  summaryFunction = twoClassSummary,
  classProbs = TRUE
)

# KNN on Training Set

attrition.knn <- train(
  Attrition ~ .,
  data = attrition.train,
  method = "knn",
  metric = "Spec",
  trControl = train.knn,
  preProcess = c("center","scale"),
  tuneLength = 20
)

# Adding predictions to Test Data
predict(attrition.knn, newdata = attrition.test ) -> attrition.test$Attrition_KNN
# creating confusion matrix
confusionMatrix(
  table(attrition.test$Attrition, attrition.test$Attrition_KNN )
)
## Confusion Matrix and Statistics
## 
##      
##        No Yes
##   No  177   5
##   Yes  24  11
##                                           
##                Accuracy : 0.8664          
##                  95% CI : (0.8137, 0.9086)
##     No Information Rate : 0.9263          
##     P-Value [Acc > NIR] : 0.9993092       
##                                           
##                   Kappa : 0.3673          
##                                           
##  Mcnemar's Test P-Value : 0.0008302       
##                                           
##             Sensitivity : 0.8806          
##             Specificity : 0.6875          
##          Pos Pred Value : 0.9725          
##          Neg Pred Value : 0.3143          
##              Prevalence : 0.9263          
##          Detection Rate : 0.8157          
##    Detection Prevalence : 0.8387          
##       Balanced Accuracy : 0.7840          
##                                           
##        'Positive' Class : No              
## 

Random Forest for Attrition

The model Was very close for Accuracy and Sensitivity for KNN but Specificity category decreased.

  No Yes

No 179 3 Yes 26 9

Accuracy : 0.8664 Sensitivity : 0.8732
Specificity : 0.7500

set.seed(200)

train.knn<- trainControl(
  method = "repeatedcv",
  number = 5,
  repeats = 50,
  summaryFunction = twoClassSummary,
  classProbs = TRUE
)
train.forest<- trainControl(
  method = "repeatedcv",
  number = 5,
  repeats=25
)
metric="Accuracy"
mtry <- sqrt(ncol(x))
## Error in ncol(x): object 'x' not found
tunegrid <- expand.grid(.mtry=mtry)
## Error in expand.grid(.mtry = mtry): object 'mtry' not found
# Random Forest
train(as.factor(Attrition) ~ .,
  data = attrition.train,
  method = "rf",
  metric = "Accuracy",
  trControl = train.forest
 
  
) -> attrition.rf

predict(attrition.rf, newdata = attrition.test ) -> attrition.test$Attrition_RF
# creating confusion matrix
confusionMatrix(
  table(attrition.test$Attrition, attrition.test$Attrition_RF )
)
## Confusion Matrix and Statistics
## 
##      
##        No Yes
##   No  174   8
##   Yes  28   7
##                                          
##                Accuracy : 0.8341         
##                  95% CI : (0.7778, 0.881)
##     No Information Rate : 0.9309         
##     P-Value [Acc > NIR] : 1.000000       
##                                          
##                   Kappa : 0.2029         
##                                          
##  Mcnemar's Test P-Value : 0.001542       
##                                          
##             Sensitivity : 0.8614         
##             Specificity : 0.4667         
##          Pos Pred Value : 0.9560         
##          Neg Pred Value : 0.2000         
##              Prevalence : 0.9309         
##          Detection Rate : 0.8018         
##    Detection Prevalence : 0.8387         
##       Balanced Accuracy : 0.6640         
##                                          
##        'Positive' Class : No             
## 

Logistic Regression Model

The accuracy and sensitivity is better and specificity is little decreased as compared to KNN model but better than the Random Forest Model. No Yes No 177 5 Yes 17 18

Accuracy : 0.8986 Sensitivity : 0.9124
Specificity : 0.7826

train.glm<- trainControl(
  method = "repeatedcv",
  number = 5,
  repeats = 10,
)
set.seed(200)
attrition.glm.model <- train(as.factor(Attrition)~., attrition.train , method = 'glm',trControl = train.forest)
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
train=case2_numeric
glm.fit=glm(Attrition~.,data=train)
#Predict
attrition.glm.pred <- predict(attrition.glm.model,newdata=attrition.test)
#Print confusion matrix
confusionMatrix(
  table(attrition.test$Attrition, attrition.glm.pred )
)
## Confusion Matrix and Statistics
## 
##      attrition.glm.pred
##        No Yes
##   No  167  15
##   Yes  16  19
##                                           
##                Accuracy : 0.8571          
##                  95% CI : (0.8034, 0.9008)
##     No Information Rate : 0.8433          
##     P-Value [Acc > NIR] : 0.3264          
##                                           
##                   Kappa : 0.4658          
##                                           
##  Mcnemar's Test P-Value : 1.0000          
##                                           
##             Sensitivity : 0.9126          
##             Specificity : 0.5588          
##          Pos Pred Value : 0.9176          
##          Neg Pred Value : 0.5429          
##              Prevalence : 0.8433          
##          Detection Rate : 0.7696          
##    Detection Prevalence : 0.8387          
##       Balanced Accuracy : 0.7357          
##                                           
##        'Positive' Class : No              
## 

Predictions for Attrition

Validating KNN on Entire Training Data Set

For the prediction on the entire training set, we found the following results:

   No Yes

No 722 8 Yes 103 37

Accuracy : 0.8724 Sensitivity : 0.8752
Specificity : 0.8222

# generating predictions on test data
case2$Attrition_KNN <- predict(attrition.knn, newdata = case2)

# creating confusion matrix for KNN
confusionMatrix(
  table(case2$Attrition, case2$Attrition_KNN )
)
## Confusion Matrix and Statistics
## 
##      
##        No Yes
##   No  720  10
##   Yes  98  42
##                                          
##                Accuracy : 0.8759         
##                  95% CI : (0.8521, 0.897)
##     No Information Rate : 0.9402         
##     P-Value [Acc > NIR] : 1              
##                                          
##                   Kappa : 0.3838         
##                                          
##  Mcnemar's Test P-Value : <2e-16         
##                                          
##             Sensitivity : 0.8802         
##             Specificity : 0.8077         
##          Pos Pred Value : 0.9863         
##          Neg Pred Value : 0.3000         
##              Prevalence : 0.9402         
##          Detection Rate : 0.8276         
##    Detection Prevalence : 0.8391         
##       Balanced Accuracy : 0.8439         
##                                          
##        'Positive' Class : No             
## 

Validating Random Forest on Entire Training Data Set

For the prediction on the entire training set, we found the following results:

   No Yes

No 727 3 Yes 26 114

Accuracy : 0.9667 Sensitivity : 0.9655
Specificity : 0.9744

# generating predictions on test data
case2$Attrition_RF <- predict(attrition.rf, newdata = case2)

# creating confusion matrix for RF
confusionMatrix(
  table(case2$Attrition, case2$Attrition_RF )
)
## Confusion Matrix and Statistics
## 
##      
##        No Yes
##   No  722   8
##   Yes  28 112
##                                           
##                Accuracy : 0.9586          
##                  95% CI : (0.9432, 0.9709)
##     No Information Rate : 0.8621          
##     P-Value [Acc > NIR] : < 2.2e-16       
##                                           
##                   Kappa : 0.8374          
##                                           
##  Mcnemar's Test P-Value : 0.001542        
##                                           
##             Sensitivity : 0.9627          
##             Specificity : 0.9333          
##          Pos Pred Value : 0.9890          
##          Neg Pred Value : 0.8000          
##              Prevalence : 0.8621          
##          Detection Rate : 0.8299          
##    Detection Prevalence : 0.8391          
##       Balanced Accuracy : 0.9480          
##                                           
##        'Positive' Class : No              
## 

Validating GLM on Entire Training Data Set

For the prediction on the entire training set, we found the following results:

   No Yes

No 708 22 Yes 66 74

Accuracy : 0.8966 Sensitivity : 0.9124
Specificity : 0.7660

# generating predictions on test data
case2$Attrition_GLM <- predict(attrition.glm.model, newdata = case2)

# creating confusion matrix for RF
confusionMatrix(
  table(case2$Attrition, case2$Attrition_GLM )
)
## Confusion Matrix and Statistics
## 
##      
##        No Yes
##   No  697  33
##   Yes  67  73
##                                          
##                Accuracy : 0.8851         
##                  95% CI : (0.862, 0.9055)
##     No Information Rate : 0.8782         
##     P-Value [Acc > NIR] : 0.2873407      
##                                          
##                   Kappa : 0.528          
##                                          
##  Mcnemar's Test P-Value : 0.0009668      
##                                          
##             Sensitivity : 0.9123         
##             Specificity : 0.6887         
##          Pos Pred Value : 0.9548         
##          Neg Pred Value : 0.5214         
##              Prevalence : 0.8782         
##          Detection Rate : 0.8011         
##    Detection Prevalence : 0.8391         
##       Balanced Accuracy : 0.8005         
##                                          
##        'Positive' Class : No             
## 

Reading the original test data for Attrition and generating the predictions of K-Nearest Neighbor model, Random Forest model, and Logistic Regression model

We have saved the predictions of the original test data in the Attrition_KNN.csv, Attrition_RF.csv and Attrition_GLM.csv

NoAttrition.df=read.csv("https://raw.githubusercontent.com/RashmiAPatel19/SMU_MSDS_6306_CaseStudy2_Spring2021/main/CaseStudy2CompSet%20No%20Attrition.csv",header=TRUE)
head(NoAttrition.df)
##     ID Age    BusinessTravel DailyRate             Department DistanceFromHome
## 1 1171  35     Travel_Rarely       750 Research & Development               28
## 2 1172  33     Travel_Rarely       147        Human Resources                2
## 3 1173  26     Travel_Rarely      1330 Research & Development               21
## 4 1174  55     Travel_Rarely      1311 Research & Development                2
## 5 1175  29     Travel_Rarely      1246                  Sales               19
## 6 1176  51 Travel_Frequently      1456 Research & Development                1
##   Education  EducationField EmployeeCount EmployeeNumber
## 1         3   Life Sciences             1           1596
## 2         3 Human Resources             1           1207
## 3         3         Medical             1           1107
## 4         3   Life Sciences             1            505
## 5         3   Life Sciences             1           1497
## 6         4         Medical             1            145
##   EnvironmentSatisfaction Gender HourlyRate JobInvolvement JobLevel
## 1                       2   Male         46              4        2
## 2                       2   Male         99              3        1
## 3                       1   Male         37              3        1
## 4                       3 Female         97              3        4
## 5                       3   Male         77              2        2
## 6                       1 Female         30              2        3
##                     JobRole JobSatisfaction MaritalStatus MonthlyIncome
## 1     Laboratory Technician               3       Married          3407
## 2           Human Resources               3       Married          3600
## 3     Laboratory Technician               3      Divorced          2377
## 4                   Manager               4        Single         16659
## 5           Sales Executive               3      Divorced          8620
## 6 Healthcare Representative               1        Single          7484
##   MonthlyRate NumCompaniesWorked Over18 OverTime PercentSalaryHike
## 1       25348                  1      Y       No                17
## 2        8429                  1      Y       No                13
## 3       19373                  1      Y       No                20
## 4       23258                  2      Y      Yes                13
## 5       23757                  1      Y       No                14
## 6       25796                  3      Y       No                20
##   PerformanceRating RelationshipSatisfaction StandardHours StockOptionLevel
## 1                 3                        4            80                2
## 2                 3                        4            80                1
## 3                 4                        3            80                1
## 4                 3                        3            80                0
## 5                 3                        3            80                2
## 6                 4                        3            80                0
##   TotalWorkingYears TrainingTimesLastYear WorkLifeBalance YearsAtCompany
## 1                10                     3               2             10
## 2                 5                     2               3              5
## 3                 1                     0               2              1
## 4                30                     2               3              5
## 5                10                     3               3             10
## 6                23                     1               2             13
##   YearsInCurrentRole YearsSinceLastPromotion YearsWithCurrManager
## 1                  9                       6                    8
## 2                  4                       1                    4
## 3                  1                       0                    0
## 4                  4                       1                    2
## 5                  7                       0                    4
## 6                 12                      12                    8
dim(NoAttrition.df)
## [1] 300  35
# creating new attrition in original test data with KNN model predicted Attrition
NoAttrition.df$Attrition_KNN <- predict(attrition.knn, NoAttrition.df)
output.knn=data.frame(Id=NoAttrition.df$ID,NoAttrition.df$Attrition_KNN)

# creating new attrition in original test data with Random Forest model predicted Attrition
NoAttrition.df$Attrition_RF <- predict(attrition.rf, NoAttrition.df)
output.rf=data.frame(Id=NoAttrition.df$ID,NoAttrition.df$Attrition_RF)

# creating new attrition in original test data with Logistic Regression model predicted Attrition
NoAttrition.df$Attrition_GLM <- predict(attrition.glm.model, NoAttrition.df)
output.glm=data.frame(Id=NoAttrition.df$ID,NoAttrition.df$Attrition_GLM)

head(output.knn)
##     Id NoAttrition.df.Attrition_KNN
## 1 1171                           No
## 2 1172                           No
## 3 1173                           No
## 4 1174                           No
## 5 1175                           No
## 6 1176                           No
head(output.rf)
##     Id NoAttrition.df.Attrition_RF
## 1 1171                          No
## 2 1172                          No
## 3 1173                          No
## 4 1174                          No
## 5 1175                          No
## 6 1176                          No
head(output.glm)
##     Id NoAttrition.df.Attrition_GLM
## 1 1171                           No
## 2 1172                           No
## 3 1173                           No
## 4 1174                           No
## 5 1175                           No
## 6 1176                           No
write.csv(output.knn,file="Attrition_KNN.csv",row.names = FALSE)
write.csv(output.rf,file="Attrition_RF.csv",row.names = FALSE)
write.csv(output.glm,file="Attrition_GLM.csv",row.names = FALSE)